SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddKnownsToLinearSystem.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2009 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 #ifndef CORE_ALGORITHMS_MATH_LINEARSYSTEM_ADDKNOWNSTOLINEARSYSTEM_H
30 #define CORE_ALGORITHMS_MATH_LINEARSYSTEM_ADDKNOWNSTOLINEARSYSTEM_H 1
31 
32 // Datatypes that the algorithm uses
33 #include <Core/Datatypes/Matrix.h>
34 
35 // Base class for algorithm
36 #include <Core/Algorithms/Util/AlgoBase.h>
37 
38 // for Windows support
40 
41 namespace SCIRunAlgo {
42 
43 using namespace SCIRun;
44 
45 // Add knowns to a linear system, set the knowns in x by giving them a value
46 // all unknowns should be marked with a NaN. This algorithm will take a linear
47 // system comprised of matrices A and b and set all the values that are specified
48 // in x to that value and will change the linear system so that these values
49 // are set.
50 //
51 // If matrix A is not sparse, set convert_matrix_types to true to convert
52 // to sparse row matrix type.
53 
54 class SCISHARE AddKnownsToLinearSystemAlgo : public AlgoBase
55 {
56  public:
57  // Set default values
59  {}
60 
61  bool run(MatrixHandle a_in,
62  MatrixHandle b_in,
63  MatrixHandle x,
64  SparseRowMatrixHandle& a_out,
65  MatrixHandle& b_out,
66  bool convert_matrix_types = false);
67 };
68 
69 
70 }
71 
72 #endif
LockingHandle< Matrix< double > > MatrixHandle
Definition: MatrixFwd.h:55
#define SCISHARE
Definition: share.h:39
LockingHandle< SparseRowMatrix > SparseRowMatrixHandle
Definition: MatrixFwd.h:58
Definition: AddKnownsToLinearSystem.h:54
AddKnownsToLinearSystemAlgo()
Definition: AddKnownsToLinearSystem.h:58