Browse Source

update cholesky flag

Erik Rodner 13 years ago
parent
commit
21dbb28d35
2 changed files with 5 additions and 4 deletions
  1. 4 3
      math/kernels/KernelData.cpp
  2. 1 1
      math/kernels/KernelData.h

+ 4 - 3
math/kernels/KernelData.cpp

@@ -47,11 +47,12 @@ KernelData::KernelData ( const KernelData & src )
   cr = src.cr->clone();
 }
 
-KernelData::KernelData ( const Config *conf, const Matrix & kernelMatrix, const string & section )
+KernelData::KernelData ( const Config *conf, const Matrix & kernelMatrix, const string & section, bool updateCholesky )
 {
   initFromConfig ( conf, section );
   this->kernelMatrix = kernelMatrix;
-  updateCholeskyFactorization();
+  if ( updateCholesky ) 
+    updateCholeskyFactorization();
 }
 
 KernelData::KernelData ( const Config *conf, const string & section )
@@ -826,4 +827,4 @@ void KernelData::increase_size_by_k ( const uint & k )
   //NOTE Maybe it would be more efficient to work directly with pointers to the memory
   choleskyMatrix.resize ( new_Kernel.rows(), new_Kernel.cols() );
   choleskyMatrix = new_Kernel;
-}
+}

+ 1 - 1
math/kernels/KernelData.h

@@ -61,7 +61,7 @@ class KernelData
 		KernelData( const NICE::Config *conf, const std::string & section = "Kernel" );
 		
 		/** the config contains information about numerical setting of the cholesky factorization etc. */
-		KernelData( const NICE::Config *conf, const NICE::Matrix & kernelMatrix, const std::string & section = "Kernel" );
+		KernelData( const NICE::Config *conf, const NICE::Matrix & kernelMatrix, const std::string & section = "Kernel", bool updateCholesky = true );
 		  
 		/** simple destructor */
 		virtual ~KernelData();