Diff of /src/multi_class.h [r78] .. [r79] Maximize Restore

  Switch to side-by-side view

--- a/src/multi_class.h
+++ b/src/multi_class.h
@@ -23,8 +23,9 @@
       virtual cls_t classify(real *x, real &pdf);
       //(only one of the two need be defined)
 
-      //linear transformation on features:
+      //linear transformation on features (plus translation...):
       virtual int ltran(real **mat, 		//tranformation matrix
+		real *b,			//constant term
 		dim_ta d1,			//first dimension of trans. mat.
 		dim_ta d2, 			//second 	"
 		int flag);			//transform model?
@@ -62,6 +63,7 @@
       nel_ta n;			//number of samples
       //real *ave;		//need these to condtion the test data
       real **mat;		//transformation matrix
+      real *b;			//translation vector
       real *xtran;		//transformed feature vector
     public:
       //initialized from a pair of files
@@ -71,7 +73,7 @@
       virtual ~agf2class();
       //transformation matrix is not copied, only the pointer is stored
       //--do not delete original before classifier class instance:
-      virtual int ltran(real **mat, dim_ta d1, dim_ta d2, int flag);
+      virtual int ltran(real **mat1, real *b1, dim_ta d1, dim_ta d2, int flag);
       virtual cls_t classify(real *x, real &pdf);
       virtual cls_t classify(real *x, real *pdf);
   };
@@ -95,7 +97,7 @@
 
       //transformation matrix is not copied, only the pointer is stored
       //--do not delete original before classifier class instance:
-      virtual int ltran(real **mat, dim_ta d1, dim_ta d2, int flag);
+      virtual int ltran(real **mat, real *b, dim_ta d1, dim_ta d2, int flag);
       virtual cls_t classify(real *x, real *pdf);
       //virtual cls_t classify(real *x, real &pdf);
       virtual dim_ta n_feat();
@@ -118,7 +120,7 @@
 
       //transformation matrix is not copied, only the pointer is stored
       //--do not delete original before classifier class instance:
-      virtual int ltran(real **mat, dim_ta d1, dim_ta d2, int flag);
+      virtual int ltran(real **mat, real *b, dim_ta d1, dim_ta d2, int flag);
       virtual cls_t classify(real *x, real &pdf);
       virtual cls_t classify(real *x, real *pdf);
       virtual cls_t n_class();