A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/dd/d65/lu__decompose_8cpp_source.html below:

TheAlgorithms/C++: numerical_methods/lu_decompose.cpp Source File

Go to the documentation of this file. 20 const char

separator =

' '

;

22 for

(

size_t

row = 0; row < v.size(); row++) {

23 for

(

size_t

col = 0; col < v[row].size(); col++)

24

out << std::left << std::setw(width) << std::setfill(separator)

39 const int

range2 = range >> 1;

45 for

(

int

i = 0; i <

mat_size

; i++) {

49

A[i][j] =

static_cast<double>

(std::rand() % range - range2);

52

std::clock_t start_t = std::clock();

54

std::clock_t end_t = std::clock();

55

std::cout <<

"Time taken: " 56

<<

static_cast<double>

(end_t - start_t) / CLOCKS_PER_SEC <<

"\n"

;

58

std::cout <<

"A = \n"

<< A <<

"\n"

;

59

std::cout <<

"L = \n"

<< L <<

"\n"

;

60

std::cout <<

"U = \n"

<< U <<

"\n"

;

67

std::cout <<

"Determinant test 1..."

;

70

std::cout <<

"passed\n"

;

72

std::cout <<

"Determinant test 2..."

;

75

std::cout <<

"passed\n"

;

77

std::cout <<

"Determinant test 3..."

;

78 matrix<float>

A3({{1.2, 2.3, 3.4}, {4.5, 5.6, 6.7}, {7.8, 8.9, 9.0}});

80

std::cout <<

"passed\n"

;

85

std::srand(std::time(NULL));

std::ostream & operator<<(std::ostream &out, matrix< T > const &v)

Functions associated with LU Decomposition of a square matrix.

double determinant_lu(const matrix< T > &A)

int lu_decomposition(const matrix< T > &A, matrix< double > *L, matrix< double > *U)

std::vector< std::valarray< T > > matrix


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4