This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!--------------------------------------------------------------------------- | |
! Gaussian elimination with partial pivoting using straightforward formulas | |
! and Fortran 90/95 features | |
!!--------------------------------------------------------------------------- | |
! gfortran -ffree-form -Wall -Wextra -fopenmp | |
!!--------------------------------------------------------------------------- | |
! [1] J. Demmel "Numerical Linear Algebra" | |
! [2] N. J. Nigham "Gaussian Elimination" | |
! | |
! ELIMINATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Gaussian partitioned elimination without pivoting using straightforward | |
! formulas and BLAS routines | |
!!--------------------------------------------------------------------------- | |
! gfortran -ffree-form -Wall -Wextra -lblas -fopenmp | |
!!--------------------------------------------------------------------------- | |
! | |
! [1] J. Demmel "Numerical Linear Algebra" | |
! [2] N. J. Nigham "Gaussian Elimination" | |
! | |
! ELIMINATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Gaussian elimination without pivoting: straightforward formulas, | |
! Fortran 90/95 features, BLAS routines | |
!!--------------------------------------------------------------------------- | |
! gfortran -ffree-form -Wall -Wextra -lblas -fopenmp | |
!!--------------------------------------------------------------------------- | |
! | |
! [1] J. Demmel "Numerical Linear Algebra" | |
! [2] N. J. Nigham "Gaussian Elimination" | |
! | |
! ELIMINATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Border matrix | |
% latex filename.tex | |
% dvipng -T tight -D 150 filename.dvi | |
\documentclass{article} | |
\usepackage{kbordermatrix} | |
\begin{document} | |
\[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Cholesky decomposition without pivoting: straightforward formulas, | |
! Fortran 90/95 features and BLAS routines | |
!!--------------------------------------------------------------------------- | |
! gfortran -ffree-form -Wall -Wextra -lblas -fopenmp | |
!!--------------------------------------------------------------------------- | |
program chol | |
!!--------------------------------------------------------------------------- | |
use omp_lib, only: omp_get_wtime | |
implicit none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Cholesky partitioned decomposition without pivoting: straightforward | |
! formulas and BLAS routines | |
!!--------------------------------------------------------------------------- | |
! gfortran -ffree-form -Wall -Wextra -lblas -fopenmp | |
!!--------------------------------------------------------------------------- | |
program chol | |
!!--------------------------------------------------------------------------- | |
use omp_lib, only: omp_get_wtime | |
implicit none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This example demonstrates the significance of understanding the moments | |
* of virtual function table creation, filling, and "deallocation". | |
*/ | |
#include <iostream> | |
class A { | |
public: | |
~A() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The program demonstrates concepts of templates and multiple inheritance. | |
// It is allowed to inherit from template classes. | |
// The inherited classes are allowed to add new template parameters. | |
// | |
// g++ -Wall -Wextra templates-and-multiple-inheritance.cpp | |
#include <iostream> | |
template <class T> | |
struct A { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Template specialization allows us to (a) provide different implementation | |
// based on a template parameter; (b) add extra methods to one templated | |
// class based on its type, but not to other templates. | |
// | |
// Inspired by | |
// http://www.cprogramming.com/tutorial/template_specialization.html | |
// | |
// Here, we demonstrate template specialization for a vector container. | |
// Vector of boolean values can be optimized for space allocation. | |
// Vector of boolean values can have an extra method that negates all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Demonstration of various rounding/truncation methods in Fortran | |
! | |
! ## Compilation line: | |
! gfortran -Wall -Wextra rounding.F90 | |
! | |
! ## Output: | |
! a: -1.6 -1.4 1.4 1.6 | |
! int(a): -1 -1 1 1 | |
! nint(a): -2 -1 1 2 | |
! ceiling(a): -1 -1 2 2 |
OlderNewer