Blender V2.61 - r43446
|
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::Eigenvalue libraries were 00025 // converted into independent functions. 00026 // - MiikaH 00027 // 00029 // Helper function, compute eigenvalues of 3x3 matrix 00031 00032 #ifndef EIGENVAL_HELPER_H 00033 #define EIGENVAL_HELPER_H 00034 00035 //#include "tnt/jama_eig.h" 00036 00037 #include <algorithm> 00038 #include <cmath> 00039 00040 using namespace std; 00041 00043 // eigenvalues of 3x3 non-symmetric matrix 00045 00046 00047 struct sEigenvalue 00048 { 00049 int n; 00050 int issymmetric; 00051 float d[3]; /* real part */ 00052 float e[3]; /* img part */ 00053 float V[3][3]; /* Eigenvectors */ 00054 00055 float H[3][3]; 00056 00057 00058 float ort[3]; 00059 00060 float cdivr; 00061 float cdivi; 00062 }; 00063 00064 void Eigentred2(sEigenvalue& eval); 00065 00066 void Eigencdiv(sEigenvalue& eval, float xr, float xi, float yr, float yi); 00067 00068 void Eigentql2 (sEigenvalue& eval); 00069 00070 void Eigenorthes (sEigenvalue& eval); 00071 00072 void Eigenhqr2 (sEigenvalue& eval); 00073 00074 int computeEigenvalues3x3(float dout[3], float a[3][3]); 00075 00076 00077 #endif