Blender V2.61 - r43446

LU_HELPER.h

Go to the documentation of this file.
00001 
00004 
00005 // This file is part of Wavelet Turbulence.
00006 // 
00007 // Wavelet Turbulence is free software: you can redistribute it and/or modify
00008 // it under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation, either version 3 of the License, or
00010 // (at your option) any later version.
00011 // 
00012 // Wavelet Turbulence is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 // 
00017 // You should have received a copy of the GNU General Public License
00018 // along with Wavelet Turbulence.  If not, see <http://www.gnu.org/licenses/>.
00019 // 
00020 // Copyright 2008 Theodore Kim and Nils Thuerey
00021 // 
00023 // Modified to not require TNT matrix library anymore. It was very slow
00024 // when being run in parallel. Required TNT JAMA:LU libraries were
00025 // converted into independent functions.
00026 //      - MiikaH
00028 
00029 #ifndef LU_HELPER_H
00030 #define LU_HELPER_H
00031 
00032 #include <cmath>
00033 #include <algorithm>
00034 
00035 using namespace std;
00036 
00038 // Helper function, compute eigenvalues of 3x3 matrix
00040 
00041 struct sLU
00042 {
00043     float values[3][3];
00044     int pivsign;
00045     int piv[3];
00046 };
00047 
00048 
00049 int isNonsingular (sLU LU_);
00050 sLU computeLU( float a[3][3]);
00051 void solveLU3x3(sLU& A, float x[3], float b[3]);
00052 
00053 
00054 #endif