SheafSystem  0.0.0.0
svd.h
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 #ifndef SVD_H
22 #define SVD_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 //$$TODO: 1. Make this a class.
29 // 2. Use matrices for arguments.
30 
31 namespace fiber_bundle
32 {
33 
34  //public:
35 
39 SHEAF_DLL_SPEC bool svd_decompose(double* xa, double* xs, double* xv,
40  int xnrows, int xncols);
41 
42 // SHEAF_DLL_SPEC bool svd_decompose(vector<e3_lite>& xa, e3_lite& xs, vector<e3_lite>& xv,
43 // int xnrows);
44 
45  //private:
46 
51 SHEAF_DLL_SPEC bool svd_reduce(double* xa, double* xw, double* xv,
52  int nrows, int ncols,
53  double* ltemp, double& lnorm);
54 
59 SHEAF_DLL_SPEC bool svd_diagonalize(double* xa, double* xw, double* xv,
60  int nrows, int ncols,
61  double* xtemp, double lnorm);
62 
66 SHEAF_DLL_SPEC double same_sign(double xa, double xb);
67 
71 SHEAF_DLL_SPEC double svd_pythag(double xa, double xb);
72 
73 
74 } // end namespace fiber_bundle
75 
76 #endif // ifndef SVD_H
SHEAF_DLL_SPEC bool svd_diagonalize(double *xa, double *xw, double *xv, int nrows, int ncols, double *xtemp, double lnorm)
Diagonalization of the bidiagonal form. Convenience function.
Definition: svd.cc:321
SHEAF_DLL_SPEC double svd_pythag(double xa, double xb)
Pthagorean theorem calculation.
Definition: svd.cc:548
SHEAF_DLL_SPEC bool svd_reduce(double *xa, double *xw, double *xv, int nrows, int ncols, double *ltemp, double &lnorm)
Householder reduction to bidiagonal form. Convenience function.
Definition: svd.cc:98
SHEAF_DLL_SPEC bool svd_decompose(double *xa, double *xs, double *xv, int xnrows, int xncols)
Perform single value decomposition.
Definition: svd.cc:38
SHEAF_DLL_SPEC double same_sign(double xa, double xb)
Convert xa to have the same sign as xb.
Definition: svd.cc:521
Namespace for the fiber_bundles component of the sheaf system.