Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef CRVMATH_H
00009 #define CRVMATH_H
00010
00011 #include "crv.h"
00012 #include <mthQR.h>
00013
00017 namespace crv {
00018
00020 int binomial(int n, int i);
00022 int trinomial(int n, int i, int j);
00024 int quadnomial(int n, int i, int j, int k);
00025
00027 inline double intpow(const double b, const int e)
00028 {
00029 switch (e) {
00030 case 0: return 1.0;
00031 case 1: return b;
00032 case 2: return b*b;
00033 case 3: return b*b*b;
00034 case 4: return b*b*b*b;
00035 case 5: return b*b*b*b*b;
00036 case 6: return b*b*b*b*b*b;
00037 default:
00038 return intpow(b, e-6) * intpow(b, 6);
00039 }
00040 }
00041
00043 void invertMatrixWithQR(int n, mth::Matrix<double>& A,
00044 mth::Matrix<double>& Ai);
00046 void invertMatrixWithPLU(int n, mth::Matrix<double>& A,
00047 mth::Matrix<double>& Ai);
00048 }
00049
00050 #endif
00051