MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
NonlinearSystem.h File Reference
#include <iostream>
#include <sstream>
#include <functional>
#include <cerrno>
#include <iomanip>
#include <limits>
#include <algorithm>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/lu.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>
#include "VoxelPools.h"
+ Include dependency graph for NonlinearSystem.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  NonlinearSystem
 
class  ReacInfo
 

Typedefs

typedef ublas::matrix< value_typematrix_type
 
typedef double value_type
 
typedef ublas::vector< value_typevector_type
 

Functions

template<class T >
bool inverse (const ublas::matrix< T > &input, ublas::matrix< T > &inverse)
 

Typedef Documentation

typedef ublas::matrix<value_type> matrix_type

Definition at line 43 of file NonlinearSystem.h.

typedef double value_type

Definition at line 41 of file NonlinearSystem.h.

typedef ublas::vector<value_type> vector_type

Definition at line 42 of file NonlinearSystem.h.

Function Documentation

template<class T >
bool inverse ( const ublas::matrix< T > &  input,
ublas::matrix< T > &  inverse 
)

Definition at line 65 of file NonlinearSystem.h.

Referenced by NonlinearSystem::compute_jacobians().

66 {
67  using namespace boost::numeric::ublas;
68  typedef permutation_matrix<std::size_t> pmatrix;
69  // create a working copy of the input
70  matrix<T> A(input);
71  // create a permutation matrix for the LU-factorization
72  pmatrix pm(A.size1());
73 
74  // perform LU-factorization
75  int res = lu_factorize(A,pm);
76  if( res != 0 ) return false;
77 
78  // create identity matrix of "inverse"
79  inverse.assign(ublas::identity_matrix<T>(A.size1()));
80 
81  // backsubstitute to get the inverse
82  lu_substitute(A, pm, inverse);
83 
84  return true;
85 }
bool inverse(const ublas::matrix< T > &input, ublas::matrix< T > &inverse)

+ Here is the caller graph for this function: