SlideShare a Scribd company logo
NONAME00.CPP May 8, 2020 Page 1
1 void Venka(){//cholesky sqrt S.P. Venkateshan, Prasanna Swaminathan,
2 //in Computational Methods in Engineering, 2014
3 //Cholesky Decomposition - an overview | ScienceDirect Topics page 7
4 //*****************************************************************************************
5 cout << "See Molanos Method STATIC CONDENSATION SQRT BANDED SYMMETRIC MATRIX-> " << endl;
6 cout << " linkedin copyright 2020 or SCRIBD" << endl;
7 cout << endl;
8 long xmax, i, j, k, i1, ma, mr, l;
9 //*****************************************************************************************
10 /*
11 xmax = 7L;
12 float **a = new float*[xmax+1L];
13 for(i = 1L; i <= xmax; a[i++] = new float[xmax +1L]);
14 for(i=1L; i<= xmax; i++)
15 for(j= i; j <= xmax; a[i][j++]=0.0);
16 a[1][1] = 9 , a[1][2] = 6, a[1][3] = 0, a[1][4] = 3;
17 a[2][2] = 8 , a[2][3] = 0, a[2][4] = 0, a[2][5] = 4;
18 a[3][3] = 16, a[3][4] = 4, a[3][5] = -4, a[3][6] = -20;
19 a[4][4] = 28, a[4][5] = 2, a[4][6] = 0, a[4][7] = 0;
20 a[5][5] = 15, a[5][6] = 9, a[5][7] = 3;
21 a[6][6] = 63, a[6][7] = 13;
22 a[7][7] = 14;
23 a[1][0]= 33 , a[2][0] = 42, a[3][0] = -76, a[4][0] = 137, a[5][0] = 154,
24 a[6][0] = 454, a[7][0] = 191;
25 */
26 xmax = 4L;
27 float **a = new float *[xmax+1L];
28 for(i = 1L; i <= xmax; a[i++] = new float [xmax +1L]);
29 //*****************************************************************************************
30 for(i=1L; i<= xmax; i++)
31 for(j= i; j <= xmax; a[i][j++]=0.0);
32 //*****************************************************************************************
33 a[1][1] = 4 , a[1][2] = 1, a[1][3] = 1, a[1][4] = 1;
34 a[2][2] = 4 , a[2][3] = 1, a[2][4] = 1;
35 a[3][3] = 4 , a[3][4] = 1;
36 a[4][4] = 4 ;
37 a[1][0]= 15.9 , a[2][0] = 17.7, a[3][0] = 13.2, a[4][0] = 9.9;
38 //*****************************************************************************************
39 for(i=1L; i<= xmax; i++){ //cholesky decmposition upper triangular matrix
40 for(j=i, i1=i-(k=1L); k <= i1; a[i][j]-=a[k][i]*a[k++][j]);
41 for(a[i][j++]=sqrt(a[i][j]); j<= xmax; a[i][j++]/=a[i][i])
42 for(k=1L; k<= i1; a[i][j]-=a[k][i]*a[k++][j]);
43 }
44 //*****************************************************************************************
45 for(i=1L; i<= xmax; i++){
46 for(j=i; j<= xmax; j++)
47 cout << "c[" << i << "][" << j << "]= " << a[i][j] << " ";
48 cout << endl;
49 }
50 cout << endl;
51 //*****************************************************************************************
52 for(i=1L; i<= xmax; a[i++][0L]/=a[i][i])//forward substitution
53 for(i1=i-(k=1L); k <= i1; a[i][0L]-=a[k][i]*a[k++][0L]);
54 //*****************************************************************************************
55 for(i=1L; i<= xmax; i++)
56 cout << "y[" << i << "]= " << a[i][0L] << " ";
57 cout << endl << endl;
58 //*****************************************************************************************
59 for(i=xmax; i >= 1L; a[i--][0L]/=a[i][i])//backward substitution
60 for(ma = (mr = xmax - (j = i + 1L) + (l = 2L)) > xmax ? xmax : mr; l <= ma; a[i][0L] -= a[i]
[i-1L+l++] * a[j++][0L]);
61 //*****************************************************************************************
62 for(i=1L; i<= xmax; i++)
63 cout << "y[" << i << "]= " << a[i][0L] << " ";
64 cout << endl;
65 getch();
66 }
67

More Related Content

Similar to Cholesky sqrt venka

Chuongtrinh led ma trix
Chuongtrinh led ma trixChuongtrinh led ma trix
Chuongtrinh led ma trix
huy hung
 
M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014
M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014
M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014
Supriya Radhakrishna
 
Pre-calculated damage.pdf
Pre-calculated damage.pdfPre-calculated damage.pdf
Pre-calculated damage.pdf
internetcustomer
 
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
Kenta Sato
 
as400 built in function- %MSSECONDS
as400 built in function- %MSSECONDSas400 built in function- %MSSECONDS
as400 built in function- %MSSECONDS
aminem_mp
 
03 - Average Rates of Changec Cameron 1 Sara Hill.pdf
03 - Average Rates of Changec Cameron 1 Sara Hill.pdf03 - Average Rates of Changec Cameron 1 Sara Hill.pdf
03 - Average Rates of Changec Cameron 1 Sara Hill.pdf
Dr Robert Craig PhD
 
Bac pc 2011_nor-cor
Bac pc 2011_nor-corBac pc 2011_nor-cor
Bac pc 2011_nor-cor
Hanane Fakhri
 
第2回 基本演算,データ型の基礎,ベクトルの操作方法
第2回 基本演算,データ型の基礎,ベクトルの操作方法第2回 基本演算,データ型の基礎,ベクトルの操作方法
第2回 基本演算,データ型の基礎,ベクトルの操作方法
Wataru Shito
 
Pembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan Tanah
Pembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan TanahPembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan Tanah
Pembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan Tanah
ChristopherAbhistaAr
 
Mohan_Sidharth_final_report_565_f14
Mohan_Sidharth_final_report_565_f14Mohan_Sidharth_final_report_565_f14
Mohan_Sidharth_final_report_565_f14
Sidharth Kumar
 
kintone university 03-1. AD+カスタマイズ入門第6版 サンプル
kintone university 03-1. AD+カスタマイズ入門第6版 サンプルkintone university 03-1. AD+カスタマイズ入門第6版 サンプル
kintone university 03-1. AD+カスタマイズ入門第6版 サンプル
Yudai Shibuya
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...
sophiabelthome
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
Brendan Gregg
 
Ut ict 13_14_answer
Ut ict 13_14_answerUt ict 13_14_answer
Ut ict 13_14_answer
ken1470
 

Similar to Cholesky sqrt venka (14)

Chuongtrinh led ma trix
Chuongtrinh led ma trixChuongtrinh led ma trix
Chuongtrinh led ma trix
 
M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014
M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014
M.TECH 1ST SEM COMPUTER SCIENCE AOS LAB PRGMS 2014
 
Pre-calculated damage.pdf
Pre-calculated damage.pdfPre-calculated damage.pdf
Pre-calculated damage.pdf
 
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
 
as400 built in function- %MSSECONDS
as400 built in function- %MSSECONDSas400 built in function- %MSSECONDS
as400 built in function- %MSSECONDS
 
03 - Average Rates of Changec Cameron 1 Sara Hill.pdf
03 - Average Rates of Changec Cameron 1 Sara Hill.pdf03 - Average Rates of Changec Cameron 1 Sara Hill.pdf
03 - Average Rates of Changec Cameron 1 Sara Hill.pdf
 
Bac pc 2011_nor-cor
Bac pc 2011_nor-corBac pc 2011_nor-cor
Bac pc 2011_nor-cor
 
第2回 基本演算,データ型の基礎,ベクトルの操作方法
第2回 基本演算,データ型の基礎,ベクトルの操作方法第2回 基本演算,データ型の基礎,ベクトルの操作方法
第2回 基本演算,データ型の基礎,ベクトルの操作方法
 
Pembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan Tanah
Pembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan TanahPembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan Tanah
Pembahasan Soal Teknik Fondasi Telapak dan Dinding Penahan Tanah
 
Mohan_Sidharth_final_report_565_f14
Mohan_Sidharth_final_report_565_f14Mohan_Sidharth_final_report_565_f14
Mohan_Sidharth_final_report_565_f14
 
kintone university 03-1. AD+カスタマイズ入門第6版 サンプル
kintone university 03-1. AD+カスタマイズ入門第6版 サンプルkintone university 03-1. AD+カスタマイズ入門第6版 サンプル
kintone university 03-1. AD+カスタマイズ入門第6版 サンプル
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
 
Ut ict 13_14_answer
Ut ict 13_14_answerUt ict 13_14_answer
Ut ict 13_14_answer
 

More from Juan Carlos Molano Toro

Example bowles pp 234 239to240 2docs
Example bowles pp 234 239to240 2docsExample bowles pp 234 239to240 2docs
Example bowles pp 234 239to240 2docs
Juan Carlos Molano Toro
 
static condensation asymmetric matrix molanos method with cholesky
static condensation asymmetric matrix molanos method with choleskystatic condensation asymmetric matrix molanos method with cholesky
static condensation asymmetric matrix molanos method with cholesky
Juan Carlos Molano Toro
 
Cholesky asymmetrical matrix molanos method
Cholesky asymmetrical matrix molanos methodCholesky asymmetrical matrix molanos method
Cholesky asymmetrical matrix molanos method
Juan Carlos Molano Toro
 
Molanos method static condensation sqrt banded matrix
Molanos method static condensation sqrt banded matrixMolanos method static condensation sqrt banded matrix
Molanos method static condensation sqrt banded matrix
Juan Carlos Molano Toro
 
The convergence of the iterated irs method
The convergence of the iterated irs methodThe convergence of the iterated irs method
The convergence of the iterated irs method
Juan Carlos Molano Toro
 
Z7igq 1f2rw
Z7igq 1f2rwZ7igq 1f2rw

More from Juan Carlos Molano Toro (6)

Example bowles pp 234 239to240 2docs
Example bowles pp 234 239to240 2docsExample bowles pp 234 239to240 2docs
Example bowles pp 234 239to240 2docs
 
static condensation asymmetric matrix molanos method with cholesky
static condensation asymmetric matrix molanos method with choleskystatic condensation asymmetric matrix molanos method with cholesky
static condensation asymmetric matrix molanos method with cholesky
 
Cholesky asymmetrical matrix molanos method
Cholesky asymmetrical matrix molanos methodCholesky asymmetrical matrix molanos method
Cholesky asymmetrical matrix molanos method
 
Molanos method static condensation sqrt banded matrix
Molanos method static condensation sqrt banded matrixMolanos method static condensation sqrt banded matrix
Molanos method static condensation sqrt banded matrix
 
The convergence of the iterated irs method
The convergence of the iterated irs methodThe convergence of the iterated irs method
The convergence of the iterated irs method
 
Z7igq 1f2rw
Z7igq 1f2rwZ7igq 1f2rw
Z7igq 1f2rw
 

Recently uploaded

[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 

Recently uploaded (20)

[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 

Cholesky sqrt venka

  • 1. NONAME00.CPP May 8, 2020 Page 1 1 void Venka(){//cholesky sqrt S.P. Venkateshan, Prasanna Swaminathan, 2 //in Computational Methods in Engineering, 2014 3 //Cholesky Decomposition - an overview | ScienceDirect Topics page 7 4 //***************************************************************************************** 5 cout << "See Molanos Method STATIC CONDENSATION SQRT BANDED SYMMETRIC MATRIX-> " << endl; 6 cout << " linkedin copyright 2020 or SCRIBD" << endl; 7 cout << endl; 8 long xmax, i, j, k, i1, ma, mr, l; 9 //***************************************************************************************** 10 /* 11 xmax = 7L; 12 float **a = new float*[xmax+1L]; 13 for(i = 1L; i <= xmax; a[i++] = new float[xmax +1L]); 14 for(i=1L; i<= xmax; i++) 15 for(j= i; j <= xmax; a[i][j++]=0.0); 16 a[1][1] = 9 , a[1][2] = 6, a[1][3] = 0, a[1][4] = 3; 17 a[2][2] = 8 , a[2][3] = 0, a[2][4] = 0, a[2][5] = 4; 18 a[3][3] = 16, a[3][4] = 4, a[3][5] = -4, a[3][6] = -20; 19 a[4][4] = 28, a[4][5] = 2, a[4][6] = 0, a[4][7] = 0; 20 a[5][5] = 15, a[5][6] = 9, a[5][7] = 3; 21 a[6][6] = 63, a[6][7] = 13; 22 a[7][7] = 14; 23 a[1][0]= 33 , a[2][0] = 42, a[3][0] = -76, a[4][0] = 137, a[5][0] = 154, 24 a[6][0] = 454, a[7][0] = 191; 25 */ 26 xmax = 4L; 27 float **a = new float *[xmax+1L]; 28 for(i = 1L; i <= xmax; a[i++] = new float [xmax +1L]); 29 //***************************************************************************************** 30 for(i=1L; i<= xmax; i++) 31 for(j= i; j <= xmax; a[i][j++]=0.0); 32 //***************************************************************************************** 33 a[1][1] = 4 , a[1][2] = 1, a[1][3] = 1, a[1][4] = 1; 34 a[2][2] = 4 , a[2][3] = 1, a[2][4] = 1; 35 a[3][3] = 4 , a[3][4] = 1; 36 a[4][4] = 4 ; 37 a[1][0]= 15.9 , a[2][0] = 17.7, a[3][0] = 13.2, a[4][0] = 9.9; 38 //***************************************************************************************** 39 for(i=1L; i<= xmax; i++){ //cholesky decmposition upper triangular matrix 40 for(j=i, i1=i-(k=1L); k <= i1; a[i][j]-=a[k][i]*a[k++][j]); 41 for(a[i][j++]=sqrt(a[i][j]); j<= xmax; a[i][j++]/=a[i][i]) 42 for(k=1L; k<= i1; a[i][j]-=a[k][i]*a[k++][j]); 43 } 44 //***************************************************************************************** 45 for(i=1L; i<= xmax; i++){ 46 for(j=i; j<= xmax; j++) 47 cout << "c[" << i << "][" << j << "]= " << a[i][j] << " "; 48 cout << endl; 49 } 50 cout << endl; 51 //***************************************************************************************** 52 for(i=1L; i<= xmax; a[i++][0L]/=a[i][i])//forward substitution 53 for(i1=i-(k=1L); k <= i1; a[i][0L]-=a[k][i]*a[k++][0L]); 54 //***************************************************************************************** 55 for(i=1L; i<= xmax; i++) 56 cout << "y[" << i << "]= " << a[i][0L] << " "; 57 cout << endl << endl; 58 //***************************************************************************************** 59 for(i=xmax; i >= 1L; a[i--][0L]/=a[i][i])//backward substitution 60 for(ma = (mr = xmax - (j = i + 1L) + (l = 2L)) > xmax ? xmax : mr; l <= ma; a[i][0L] -= a[i] [i-1L+l++] * a[j++][0L]); 61 //***************************************************************************************** 62 for(i=1L; i<= xmax; i++) 63 cout << "y[" << i << "]= " << a[i][0L] << " "; 64 cout << endl; 65 getch(); 66 } 67