The Numerical Recipes codes have been rewritten in Fortran 90/95 and C/C++ by us. The original source codes are taken from the widely used software package LAPACK, which follows two other popular packages developed in the 1970s, namely EISPACK and LINPACK.
$$
\mathbf{A} =
\begin{bmatrix} a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
a_{31} & a_{32} & a_{33} & a_{34} \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{bmatrix}\qquad
\mathbf{I} =
\begin{bmatrix} 1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}
$$
The inverse of a matrix is defined by
$$
\mathbf{A}^{-1} \cdot \mathbf{A} = I
$$
| Relations | Name | matrix elements |
|---|---|---|
| \( A = A^{T} \) | symmetric | \( a_{ij} = a_{ji} \) |
| \( A = \left (A^{T} \right )^{-1} \) | real orthogonal | \( \sum_k a_{ik} a_{jk} = \sum_k a_{ki} a_{kj} = \delta_{ij} \) |
| \( A = A^{ * } \) | real matrix | \( a_{ij} = a_{ij}^{ * } \) |
| \( A = A^{\dagger} \) | hermitian | \( a_{ij} = a_{ji}^{ * } \) |
| \( A = \left (A^{\dagger} \right )^{-1} \) | unitary | \( \sum_k a_{ik} a_{jk}^{ * } = \sum_k a_{ki}^{ * } a_{kj} = \delta_{ij} \) |
For an \( N\times N \) matrix \( \mathbf{A} \) the following properties are all equivalent
The basic matrix operations that we will deal with are addition and subtraction
$$
\begin{equation}
\mathbf{A}= \mathbf{B}\pm\mathbf{C} \Longrightarrow a_{ij} = b_{ij}\pm c_{ij},
\tag{1}
\end{equation}
$$
scalar-matrix multiplication
$$
\begin{equation}
\mathbf{A}= \gamma\mathbf{B} \Longrightarrow a_{ij} = \gamma b_{ij},
\tag{2}
\end{equation}
$$
vector-matrix multiplication
$$
\begin{equation}
\mathbf{y}=\mathbf{Ax} \Longrightarrow y_{i} = \sum_{j=1}^{n} a_{ij}x_j,
\tag{3}
\end{equation}
$$
matrix-matrix multiplication
$$
\begin{equation}
\mathbf{A}=\mathbf{BC} \Longrightarrow a_{ij} = \sum_{k=1}^{n} b_{ik}c_{kj},
\tag{4}
\end{equation}
$$
and transposition
$$
\begin{equation}
\mathbf{A}=\mathbf{B}^T \Longrightarrow a_{ij} = b_{ji}
\tag{5}
\end{equation}
$$
Similarly, important vector operations that we will deal with are addition and subtraction
$$
\begin{equation}
\mathbf{x}= \mathbf{y}\pm\mathbf{z} \Longrightarrow x_{i} = y_{i}\pm z_{i},
\tag{6}
\end{equation}
$$
scalar-vector multiplication
$$
\begin{equation}
\mathbf{x}= \gamma\mathbf{y} \Longrightarrow x_{i} = \gamma y_{i},
\tag{7}
\end{equation}
$$
vector-vector multiplication (called Hadamard multiplication)
$$
\begin{equation}
\mathbf{x}=\mathbf{yz} \Longrightarrow x_{i} = y_{i}z_i,
\tag{8}
\end{equation}
$$
the inner or so-called dot product resulting in a constant
$$
\begin{equation}
x=\mathbf{y}^T\mathbf{z} \Longrightarrow x = \sum_{j=1}^{n} y_{j}z_{j},
\tag{9}
\end{equation}
$$
and the outer product, which yields a matrix,
$$
\begin{equation}
\mathbf{A}= \mathbf{yz}^T \Longrightarrow a_{ij} = y_{i}z_{j},
\tag{10}
\end{equation}
$$
We have an \( N\times N \) matrix A with \( N=100 \) In C/C++ this would be defined as
int N = 100;
double A[100][100];
// initialize all elements to zero
for(i=0 ; i < N ; i++) {
for(j=0 ; j < N ; j++) {
A[i][j] = 0.0;
Note the way the matrix is organized, row-major order.
We have \( N\times N \) matrices A, B and C and we wish to evaluate \( A=B+C \).
$$
\mathbf{A}= \mathbf{B}\pm\mathbf{C} \Longrightarrow a_{ij} = b_{ij}\pm c_{ij},
$$
In C/C++ this would be coded like
for(i=0 ; i < N ; i++) {
for(j=0 ; j < N ; j++) {
a[i][j] = b[i][j]+c[i][j]
We have \( N\times N \) matrices A, B and C and we wish to evaluate \( A=BC \).
$$
\mathbf{A}=\mathbf{BC} \Longrightarrow a_{ij} = \sum_{k=1}^{n} b_{ik}c_{kj},
$$
In C/C++ this would be coded like
for(i=0 ; i < N ; i++) {
for(j=0 ; j < N ; j++) {
for(k=0 ; k < N ; k++) {
a[i][j]+=b[i][k]*c[k][j];
ALLOCATE (a(N,N), b(N,N), c(N,N))
DO j=1, N
DO i=1, N
a(i,j)=b(i,j)+c(i,j)
ENDDO
ENDDO
...
DEALLOCATE(a,b,c)
Fortran 90 writes the above statements in a much simpler way
a=b+c
Multiplication
a=MATMUL(b,c)
Fortran contains also the intrinsic functions TRANSPOSE and CONJUGATE.
At least three possibilities in this course
int N;
double ** A;
A = new double*[N]
for ( i = 0; i < N; i++)
A[i] = new double[N];
Always free space when you don't need an array anymore.
for ( i = 0; i < N; i++)
delete[] A[i];
delete[] A;
#include <iostream>
#include <armadillo>
using namespace std;
using namespace arma;
int main(int argc, char** argv)
{
mat A = randu<mat>(5,5);
mat B = randu<mat>(5,5);
cout << A*B << endl;
return 0;
For people using Ubuntu, Debian, Linux Mint, simply go to the synaptic package manager and install armadillo from there. You may have to install Lapack as well. For Mac and Windows users, follow the instructions from the webpage http://arma.sourceforge.net. To compile, use for example (linux/ubuntu)
c++ -O2 -o program.x program.cpp -larmadillo -llapack -lblas
where the -l
option indicates the library you wish to link to.
For OS X users you may have to declare the paths to the include files and the libraries as
c++ -O2 -o program.x program.cpp -L/usr/local/lib -I/usr/local/include -larmadillo -llapack -lblas
#include <iostream>
#include "armadillo"
using namespace arma;
using namespace std;
int main(int argc, char** argv)
{
// directly specify the matrix size (elements are uninitialised)
mat A(2,3);
// .n_rows = number of rows (read only)
// .n_cols = number of columns (read only)
cout << "A.n_rows = " << A.n_rows << endl;
cout << "A.n_cols = " << A.n_cols << endl;
// directly access an element (indexing starts at 0)
A(1,2) = 456.0;
A.print("A:");
// scalars are treated as a 1x1 matrix,
// hence the code below will set A to have a size of 1x1
A = 5.0;
A.print("A:");
// if you want a matrix with all elements set to a particular value
// the .fill() member function can be used
A.set_size(3,3);
A.fill(5.0); A.print("A:");
mat B;
// endr indicates "end of row"
B << 0.555950 << 0.274690 << 0.540605 << 0.798938 << endr
<< 0.108929 << 0.830123 << 0.891726 << 0.895283 << endr
<< 0.948014 << 0.973234 << 0.216504 << 0.883152 << endr
<< 0.023787 << 0.675382 << 0.231751 << 0.450332 << endr;
// print to the cout stream
// with an optional string before the contents of the matrix
B.print("B:");
// the << operator can also be used to print the matrix
// to an arbitrary stream (cout in this case)
cout << "B:" << endl << B << endl;
// save to disk
B.save("B.txt", raw_ascii);
// load from disk
mat C;
C.load("B.txt");
C += 2.0 * B;
C.print("C:");
// submatrix types:
//
// .submat(first_row, first_column, last_row, last_column)
// .row(row_number)
// .col(column_number)
// .cols(first_column, last_column)
// .rows(first_row, last_row)
cout << "C.submat(0,0,3,1) =" << endl;
cout << C.submat(0,0,3,1) << endl;
// generate the identity matrix
mat D = eye<mat>(4,4);
D.submat(0,0,3,1) = C.cols(1,2);
D.print("D:");
// transpose
cout << "trans(B) =" << endl;
cout << trans(B) << endl;
// maximum from each column (traverse along rows)
cout << "max(B) =" << endl;
cout << max(B) << endl;
// maximum from each row (traverse along columns)
cout << "max(B,1) =" << endl;
cout << max(B,1) << endl;
// maximum value in B
cout << "max(max(B)) = " << max(max(B)) << endl;
// sum of each column (traverse along rows)
cout << "sum(B) =" << endl;
cout << sum(B) << endl;
// sum of each row (traverse along columns)
cout << "sum(B,1) =" << endl;
cout << sum(B,1) << endl;
// sum of all elements
cout << "sum(sum(B)) = " << sum(sum(B)) << endl;
cout << "accu(B) = " << accu(B) << endl;
// trace = sum along diagonal
cout << "trace(B) = " << trace(B) << endl;
// random matrix -- values are uniformly distributed in the [0,1] interval
mat E = randu<mat>(4,4);
E.print("E:");
// row vectors are treated like a matrix with one row
rowvec r;
r << 0.59499 << 0.88807 << 0.88532 << 0.19968;
r.print("r:");
// column vectors are treated like a matrix with one column
colvec q;
q << 0.81114 << 0.06256 << 0.95989 << 0.73628;
q.print("q:");
// dot or inner product
cout << "as_scalar(r*q) = " << as_scalar(r*q) << endl;
// outer product
cout << "q*r =" << endl;
cout << q*r << endl;
// sum of three matrices (no temporary matrices are created)
mat F = B + C + D;
F.print("F:");
return 0;
#include <iostream>
#include "armadillo"
using namespace arma;
using namespace std;
int main(int argc, char** argv)
{
cout << "Armadillo version: " << arma_version::as_string() << endl;
mat A;
A << 0.165300 << 0.454037 << 0.995795 << 0.124098 << 0.047084 << endr
<< 0.688782 << 0.036549 << 0.552848 << 0.937664 << 0.866401 << endr
<< 0.348740 << 0.479388 << 0.506228 << 0.145673 << 0.491547 << endr
<< 0.148678 << 0.682258 << 0.571154 << 0.874724 << 0.444632 << endr
<< 0.245726 << 0.595218 << 0.409327 << 0.367827 << 0.385736 << endr;
A.print("A =");
// determinant
cout << "det(A) = " << det(A) << endl;
// inverse
cout << "inv(A) = " << endl << inv(A) << endl;
double k = 1.23;
mat B = randu<mat>(5,5);
mat C = randu<mat>(5,5);
rowvec r = randu<rowvec>(5);
colvec q = randu<colvec>(5);
// examples of some expressions
// for which optimised implementations exist
// optimised implementation of a trinary expression
// that results in a scalar
cout << "as_scalar( r*inv(diagmat(B))*q ) = ";
cout << as_scalar( r*inv(diagmat(B))*q ) << endl;
// example of an expression which is optimised
// as a call to the dgemm() function in BLAS:
cout << "k*trans(B)*C = " << endl << k*trans(B)*C;
return 0;
We start with the linear set of equations
$$
\mathbf{A}\mathbf{x} = \mathbf{w}.
$$
We assume also that the matrix \( \mathbf{A} \) is non-singular and that the
matrix elements along the diagonal satisfy \( a_{ii} \ne 0 \). Simple \( 4\times 4 \) example
$$
\begin{bmatrix}
a_{11}& a_{12} &a_{13}& a_{14}\\
a_{21}& a_{22} &a_{23}& a_{24}\\
a_{31}& a_{32} &a_{33}& a_{34}\\
a_{41}& a_{42} &a_{43}& a_{44}\\
\end{bmatrix} \begin{bmatrix}
x_1\\
x_2\\
x_3 \\
x_4 \\
\end{bmatrix}
=\begin{bmatrix}
w_1\\
w_2\\
w_3 \\
w_4\\
\end{bmatrix}.
$$
$$
\begin{align}
a_{11}x_1 +a_{12}x_2 +a_{13}x_3 + a_{14}x_4=&w_1 \nonumber \\
a_{21}x_1 + a_{22}x_2 + a_{23}x_3 + a_{24}x_4=&w_2 \nonumber \\
a_{31}x_1 + a_{32}x_2 + a_{33}x_3 + a_{34}x_4=&w_3 \nonumber \\
a_{41}x_1 + a_{42}x_2 + a_{43}x_3 + a_{44}x_4=&w_4. \nonumber
\end{align}
$$
The basic idea of Gaussian elimination is to use the first equation to eliminate the first unknown \( x_1 \) from the remaining \( n-1 \) equations. Then we use the new second equation to eliminate the second unknown \( x_2 \) from the remaining \( n-2 \) equations. With \( n-1 \) such eliminations we obtain a so-called upper triangular set of equations of the form
$$
\begin{align}
b_{11}x_1 +b_{12}x_2 +b_{13}x_3 + b_{14}x_4=&y_1 \nonumber \\
b_{22}x_2 + b_{23}x_3 + b_{24}x_4=&y_2 \nonumber \\
b_{33}x_3 + b_{34}x_4=&y_3 \nonumber \\
b_{44}x_4=&y_4. \nonumber
\tag{11}
\end{align}
$$
We can solve this system of equations recursively starting from \( x_n \) (in our case \( x_4 \)) and proceed with
what is called a backward substitution.
$$
\begin{equation}
x_m = \frac{1}{b_{mm}}\left(y_m-\sum_{k=m+1}^nb_{mk}x_k\right)\quad m=n-1,n-2,\dots,1.
\tag{12}
\end{equation}
$$
To arrive at such an upper triangular system of equations, we start by eliminating
the unknown \( x_1 \) for \( j=2,n \). We achieve this by multiplying the first equation by \( a_{j1}/a_{11} \) and then subtract
the result from the $j$th equation. We assume obviously that \( a_{11}\ne 0 \) and that
\( \mathbf{A} \) is not singular.
Our actual \( 4\times 4 \) example reads after the first operation
$$
\begin{bmatrix}
a_{11}& a_{12} &a_{13}& a_{14}\\
0& (a_{22}-\frac{a_{21}a_{12}}{a_{11}}) &(a_{23}-\frac{a_{21}a_{13}}{a_{11}}) & (a_{24}-\frac{a_{21}a_{14}}{a_{11}})\\
0& (a_{32}-\frac{a_{31}a_{12}}{a_{11}})& (a_{33}-\frac{a_{31}a_{13}}{a_{11}})& (a_{34}-\frac{a_{31}a_{14}}{a_{11}})\\
0&(a_{42}-\frac{a_{41}a_{12}}{a_{11}}) &(a_{43}-\frac{a_{41}a_{13}}{a_{11}}) & (a_{44}-\frac{a_{41}a_{14}}{a_{11}}) \\
\end{bmatrix} \begin{bmatrix}
x_1\\
x_2\\
x_3 \\
x_4 \\
\end{bmatrix}
=\begin{bmatrix}
y_1\\
w_2^{(2)}\\
w_3^{(2)} \\
w_4^{(2)}\\
\end{bmatrix},
$$
or
$$
\begin{align}
b_{11}x_1 +b_{12}x_2 +b_{13}x_3 + b_{14}x_4=&y_1 \nonumber \\
a^{(2)}_{22}x_2 + a^{(2)}_{23}x_3 + a^{(2)}_{24}x_4=&w^{(2)}_2 \nonumber \\
a^{(2)}_{32}x_2 + a^{(2)}_{33}x_3 + a^{(2)}_{34}x_4=&w^{(2)}_3 \nonumber \\
a^{(2)}_{42}x_2 + a^{(2)}_{43}x_3 + a^{(2)}_{44}x_4=&w^{(2)}_4, \nonumber \\
\tag{13}
\end{align}
$$
The new coefficients are
$$
\begin{equation}
b_{1k} = a_{1k}^{(1)} \quad k=1,\dots,n,
\tag{14}
\end{equation}
$$
where each \( a_{1k}^{(1)} \) is equal to the original \( a_{1k} \) element. The other coefficients are
$$
\begin{equation}
a_{jk}^{(2)} = a_{jk}^{(1)}-\frac{a_{j1}^{(1)}a_{1k}^{(1)}}{a_{11}^{(1)}} \quad j,k=2,\dots,n,
\tag{15}
\end{equation}
$$
with a new right-hand side given by
$$
\begin{equation}
y_{1}=w_1^{(1)}, \quad w_j^{(2)} =w_j^{(1)}-\frac{a_{j1}^{(1)}w_1^{(1)}}{a_{11}^{(1)}} \quad j=2,\dots,n.
\tag{16}
\end{equation}
$$
We have also set \( w_1^{(1)}=w_1 \), the original vector element.
We see that the system of unknowns \( x_1,\dots,x_n \) is transformed into an \( (n-1)\times (n-1) \) problem.
This step is called forward substitution. Proceeding with these substitutions, we obtain the general expressions for the new coefficients
$$
\begin{equation}
a_{jk}^{(m+1)} = a_{jk}^{(m)}-\frac{a_{jm}^{(m)}a_{mk}^{(m)}}{a_{mm}^{(m)}} \quad j,k=m+1,\dots,n,
\tag{17}
\end{equation}
$$
with \( m=1,\dots,n-1 \) and a
right-hand side given by
$$
\begin{equation}
w_j^{(m+1)} =w_j^{(m)}-\frac{a_{jm}^{(m)}w_m^{(m)}}{a_{mm}^{(m)}}\quad j=m+1,\dots,n.
\tag{18}
\end{equation}
$$
This set of \( n-1 \) elimations leads us to an equations which is solved by back substitution.
If the arithmetics is exact and the matrix \( \mathbf{A} \) is not singular, then the computed answer will be exact.
Even though the matrix elements along the diagonal are not zero, numerically small numbers may appear and subsequent divisions may lead to large numbers, which, if added to a small number may yield losses of precision. Suppose for example that our first division in \( (a_{22}-a_{21}a_{12}/a_{11}) \) results in \( -10^{-7} \) and that \( a_{22} \) is one. one. We are then adding \( 10^7+1 \). With single precision this results in \( 10^7 \).
Suppose we want to solve the following boundary value equation
$$
-\frac{d^2u(x)}{dx^2} = f(x,u(x)),
$$
with \( x\in (a,b) \) and with boundary conditions \( u(a)=u(b) = 0 \).
We assume that \( f \) is a continuous function in the domain \( x\in (a,b) \).
Since, except the few cases where it is possible to find analytic solutions, we
will seek after approximate solutions, we choose to represent the approximation to the second derivative
from the previous chapter
$$
f''=\frac{f_h -2f_0 +f_{-h}}{h^2} +O(h^2).
$$
We subdivide our interval \( x\in (a,b) \) into \( n \) subintervals by setting \( x_i = ih \), with \( i=0,1,\dots,n+1 \).
The step size is then given by \( h=(b-a)/(n+1) \) with \( n\in {\mathbb{N}} \).
For the internal grid points \( i=1,2,\dots n \) we replace the differential operator with the above formula
resulting in
$$
u''(x_i) \approx \frac{u(x_i+h) -2u(x_i) +u(x_i-h)}{h^2},
$$
which we rewrite as
$$
u^{''}_i \approx \frac{u_{i+1} -2u_i +u_{i-i}}{h^2}.
$$
We can rewrite our original differential equation in terms of a discretized equation with approximations to the derivatives as
$$
-\frac{u_{i+1} -2u_i +u_{i-i}}{h^2}=f(x_i,u(x_i)),
$$
with \( i=1,2,\dots, n \). We need to add to this system the two boundary conditions \( u(a) =u_0 \) and \( u(b) = u_{n+1} \).
If we define a matrix
$$
\mathbf{A} = \frac{1}{h^2}\begin{bmatrix}
2 & -1 & & & & \\
-1 & 2 & -1 & & & \\
& -1 & 2 & -1 & & \\
& \dots & \dots &\dots &\dots & \dots \\
& & &-1 &2& -1 \\
& & & &-1 & 2 \\
\end{bmatrix}
$$
and the corresponding vectors \( \mathbf{u} = (u_1, u_2, \dots,u_n)^T \) and
\( \mathbf{f}(\mathbf{u}) = f(x_1,x_2,\dots, x_n,u_1, u_2, \dots,u_n)^T \) we can rewrite the differential equation
including the boundary conditions as a system of linear equations with a large number of unknowns
$$
\mathbf{A}\mathbf{u} = \mathbf{f}(\mathbf{u}).
$$
We start with the linear set of equations
$$
\mathbf{A}\mathbf{u} = \mathbf{f},
$$
where \( \mathbf{A} \) is a tridiagonal matrix which we rewrite as
$$
\mathbf{A} = \begin{bmatrix}
b_1& c_1 & 0 &\dots & \dots &\dots \\
a_2 & b_2 & c_2 &\dots &\dots &\dots \\
& a_3 & b_3 & c_3 & \dots & \dots \\
& \dots & \dots &\dots &\dots & \dots \\
& & &a_{n-1} &b_{n-1}& c_{n-1} \\
& & & &a_n & b_n \\
\end{bmatrix}
$$
where \( a,b,c \) are one-dimensional arrays of length \( 1:n \).
In project 1 the arrays \( a \) and \( c \) are equal, namely \( a_i=c_i=-1/h^2 \).
The matrix is also positive definite.
We can rewrite as
$$
\mathbf{A} = \begin{bmatrix}
b_1& c_1 & 0 &\dots & \dots &\dots \\
a_2 & b_2 & c_2 &\dots &\dots &\dots \\
& a_3 & b_3 & c_3 & \dots & \dots \\
& \dots & \dots &\dots &\dots & \dots \\
& & &a_{n-1} &b_{n-1}& c_{n-1} \\
& & & &a_n & b_n \\
\end{bmatrix} \begin{bmatrix}
u_1\\
u_2\\
\dots \\
\dots \\
\dots \\
u_n\\
\end{bmatrix}
=\begin{bmatrix}
f_1\\
f_2\\
\dots \\
\dots \\
\dots \\
f_n\\
\end{bmatrix}.
$$
A tridiagonal matrix is a special form of banded matrix where all the elements are zero except for those on and immediately above and below the leading diagonal. The above tridiagonal system can be written as
$$
a_iu_{i-1}+b_iu_i+c_iu_{i+1} = f_i,
$$
for \( i=1,2,\dots,n \). We see that \( u_{-1} \) and \( u_{n+1} \) are not required and we can set \( a_1=c_n=0 \).
In many applications the matrix is symmetric and we have \( a_i=c_i \).
The algorithm for solving this set of equations is rather simple and requires two steps only,
a forward substitution and a backward substitution. These steps are also
common to the algorithms based on
Gaussian elimination that
we discussed previously. However, due to its simplicity, the number of floating point operations
is in this
case proportional with \( O(n) \) while Gaussian elimination requires \( 2n^3/3+O(n^2) \) floating point operations.
In case your system of equations leads to a tridiagonal matrix, it is clearly an overkill to employ Gaussian elimination or the standard LU decomposition.
Our algorithm starts with forward substitution with a loop over of the elements \( i \) and gives an update of the diagonal elements \( b_i \) given by the new diagonals \( \tilde{b}_i \)
$$
\tilde{b}_i= b_i - \frac{a_ic_{i-1}}{\tilde{b}_{i-1}},
$$
and the new righthand side \( \tilde{f}_i \) given by
$$
\tilde{f}_i= f_i - \frac{a_i\tilde{f}_{i-1}}{\tilde{b}_{i-1}}.
$$
Recall that \( \tilde{b}_1=b_1 \) and \( \tilde{f}_1=f_1 \) always.
The backward substitution gives then the final solution
$$
u_{i-1}= \frac{\tilde{f}_{i-1}-c_{i-1}u_i}{\tilde{b}_{i-1}},
$$
with \( u_n=\tilde{f}_{n}/\tilde{b}_{n} \) when \( i=n \), the last point.
The matrix \( \mathbf{A} \) which rephrases a second derivative in a discretized form is much simpler than the general matrix
$$
\mathbf{A} = \begin{bmatrix}
2 & -1 & 0 & 0 &0 & 0\\
-1 & 2 & -1 &0 &0 &0 \\
0 & -1 & 2 & -1 & 0& 0 \\
0 & \dots & \dots & \dots &\dots & \dots \\
0 &0 &0 &-1 &2& -1 \\
0 & 0 &0 &0 &-1 & 2 \\
\end{bmatrix}.
$$
This matrix fulfills the condition of a weak dominance of the diagonal, with
\( |b_1| > |c_1| \), \( |b_n| > |a_n| \) and \( |b_k| \ge |a_k|+|c_k| \) for \( k=2,3,\dots,n-1 \).
This is a relevant but not sufficient condition to guarantee that the matrix \( \mathbf{A} \) yields a solution to a linear
equation problem. The matrix needs also to be irreducible. A tridiagonal irreducible matrix means that all the elements \( a_i \) and
\( c_i \) are non-zero. If these two conditions are present, then \( \mathbf{A} \) is nonsingular and has a unique LU decomposition.
When setting up the algo it is useful to note that the different operations on the matrix (here as a \( 4\times 4 \) case with diagonals \( d_i \) and off-diagonals \( e_i \)) give is an extremely simple algorithm, namely
$$
\begin{bmatrix}
d_1 & e_1 & 0 & 0 \\
e_2 & d_2 & e_2 & 0 \\
0 & e_3 & d_3 & e_3 \\
0 & 0 & e_4 & d_4
\end{bmatrix}\rightarrow
\begin{bmatrix}
d_1 & e_1 & 0 & 0 \\
0 & \tilde{d}_2 & e_2 & 0 \\
0 & e_3 & d_3 & e_3 \\
0 & 0 & e_4 & d_4
\end{bmatrix}\rightarrow
\begin{bmatrix}
d_1 & e_1 & 0 & 0 \\
0 & \tilde{d}_2 & e_2 & 0 \\
0 & 0 & \tilde{d}_3 & e_3 \\
0 & 0 & e_4 & d_4
\end{bmatrix}
$$
and finally
$$
\begin{bmatrix}
d_1 & e_1 & 0 & 0 \\
0 & \tilde{d}_2 & e_2 & 0 \\
0 & 0 & \tilde{d}_3 & e_3 \\
0 & 0 & 0 & \tilde{d}_4
\end{bmatrix}
$$
We notice the sub-blocks which get repeated
$$
\begin{bmatrix}
d_1 & e_1 & 0 & 0 \\
0 & \tilde{d}_2 & e_2 & 0 \\
0 & 0 & \tilde{d}_3 & e_3 \\
0 & 0 & 0 & \tilde{d}_4
\end{bmatrix}
$$
The matrices we often end up with in rewriting for for example partial differential equations,
have the feature that all leading principal submatrices are non-singular.
$$
\tilde{d}_i= 2 - \frac{1}{\tilde{d}_{i-1}}=\frac{i+1}{i},
$$
and the new righthand side \( \tilde{f}_i \) given by
$$
\tilde{f}_i= f_i + \frac{(i-1)\tilde{f}_{i-1}}{i}.
$$
Recall that \( \tilde{d}_1=2 \) and \( \tilde{f}_1=f_1 \). These arrays can be set up before computing \( u \).
The backward substitution gives then the final solution
$$
u_{i-1}= \frac{i-1}{i}\left(\tilde{f}_{i-1}+u_i\right),
$$
with \( u_n=\tilde{f}_{n}/\tilde{b}_{n} \).
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <string>
// use namespace for output and input
using namespace std;
// object for output files
ofstream ofile;
// Functions used
inline double f(double x){return 100.0*exp(-10.0*x);
}
inline double exact(double x) {return 1.0-(1-exp(-10))*x-exp(-10*x);}
// Begin main program
int main(int argc, char *argv[]){
int exponent;
string filename;
// We read also the basic name for the output file and the highest power of 10^n we want
if( argc <= 1 ){
cout << "Bad Usage: " << argv[0] <<
" read also file name on same line and max power 10^n" << endl;
exit(1);
}
else{
filename = argv[1]; // first command line argument after name of program
exponent = atoi(argv[2]);
}
// Loop over powers of 10
for (int i = 1; i <= exponent; i++){
int n = (int) pow(10.0,i);
// Declare new file name
string fileout = filename;
// Convert the power 10^i to a string
string argument = to_string(i);
// Final filename as filename-i-
fileout.append(argument);
double h = 1.0/(n);
double hh = h*h;
// Set up arrays for the simple case
double *d = new double [n+1]; double *b = new double [n+1]; double *solution = new double [n+1];
double *x = new double[n+1];
// Quick setup of updated diagonal elements and value of
d[0] = d[n] = 2; solution[0] = solution[n] = 0.0;
for (int i = 1; i < n; i++) d[i] = (i+1.0)/( (double) i);
for (int i = 0; i <= n; i++){
x[i]= i*h;
b[i] = hh*f(i*h);
}
// Forward substitution
for (int i = 2; i < n; i++) b[i] = b[i] + b[i-1]/d[i-1];
// Backward substitution
solution[n-1] = b[n-1]/d[n-1];
for (int i = n-2; i > 0; i--) solution[i] = (b[i]+solution[i+1])/d[i];
ofile.open(fileout);
ofile << setiosflags(ios::showpoint | ios::uppercase);
// ofile << " x: approx: exact: relative error" << endl;
for (int i = 1; i < n;i++) {
double xval = x[i];
double RelativeError = fabs((exact(xval)-solution[i])/exact(xval));
ofile << setw(15) << setprecision(8) << xval;
ofile << setw(15) << setprecision(8) << solution[i];
ofile << setw(15) << setprecision(8) << exact(xval);
ofile << setw(15) << setprecision(8) << log10(RelativeError) << endl;
}
ofile.close();
delete [] x; delete [] d; delete [] b; delete [] solution;
}
return 0;
}
The LU decomposition method means that we can rewrite this matrix as the product of two matrices \( \mathbf{L} \) and \( \mathbf{U} \) where
$$
\begin{bmatrix}
a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
a_{31} & a_{32} & a_{33} & a_{34} \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{bmatrix}
= \begin{bmatrix}
1 & 0 & 0 & 0 \\
l_{21} & 1 & 0 & 0 \\
l_{31} & l_{32} & 1 & 0 \\
l_{41} & l_{42} & l_{43} & 1
\end{bmatrix}
\begin{bmatrix}
u_{11} & u_{12} & u_{13} & u_{14} \\
0 & u_{22} & u_{23} & u_{24} \\
0 & 0 & u_{33} & u_{34} \\
0 & 0 & 0 & u_{44}
\end{bmatrix}.
$$
LU decomposition forms the backbone of other algorithms in linear algebra, such as the solution of linear equations given by
$$
\begin{align}
a_{11}x_1 +a_{12}x_2 +a_{13}x_3 + a_{14}x_4=&w_1 \nonumber \\
a_{21}x_1 + a_{22}x_2 + a_{23}x_3 + a_{24}x_4=&w_2 \nonumber \\
a_{31}x_1 + a_{32}x_2 + a_{33}x_3 + a_{34}x_4=&w_3 \nonumber \\
a_{41}x_1 + a_{42}x_2 + a_{43}x_3 + a_{44}x_4=&w_4. \nonumber
\end{align}
$$
The above set of equations is conveniently solved by using LU decomposition as an intermediate step.
The matrix \( \mathbf{A}\in \mathbb{R}^{n\times n} \) has an LU factorization if the determinant is different from zero. If the LU factorization exists and \( \mathbf{A} \) is non-singular, then the LU factorization is unique and the determinant is given by
$$
det\{\mathbf{A}\}=det\{\mathbf{LU}\}= det\{\mathbf{L}\}det\{\mathbf{U}\}=u_{11}u_{22}\dots u_{nn}.
$$
There are at least three main advantages with LU decomposition compared with standard Gaussian elimination:
With the LU decomposition it is rather simple to solve a system of linear equations
$$
\begin{align}
a_{11}x_1 +a_{12}x_2 +a_{13}x_3 + a_{14}x_4=&w_1 \nonumber \\
a_{21}x_1 + a_{22}x_2 + a_{23}x_3 + a_{24}x_4=&w_2 \nonumber \\
a_{31}x_1 + a_{32}x_2 + a_{33}x_3 + a_{34}x_4=&w_3 \nonumber \\
a_{41}x_1 + a_{42}x_2 + a_{43}x_3 + a_{44}x_4=&w_4. \nonumber
\end{align}
$$
This can be written in matrix form as
$$ \mathbf{Ax}=\mathbf{w}. $$
where \( \mathbf{A} \) and \( \mathbf{w} \) are known and we have to solve for \( \mathbf{x} \). Using the LU dcomposition we write
$$ \mathbf{A} \mathbf{x} \equiv \mathbf{L} \mathbf{U} \mathbf{x} =\mathbf{w}. $$
The previous equation can be calculated in two steps
$$ \mathbf{L} \mathbf{y} = \mathbf{w};\qquad \mathbf{Ux}=\mathbf{y}. $$
To show that this is correct we use to the LU decomposition to rewrite our system of linear equations as
$$ \mathbf{LUx}=\mathbf{w}, $$
and since the determinat of \( \mathbf{L} \) is equal to 1 (by construction
since the diagonals of \( \mathbf{L} \) equal 1) we can use the inverse of
\( \mathbf{L} \) to obtain
$$
\mathbf{Ux}=\mathbf{L^{-1}w}=\mathbf{y},
$$
which yields the intermediate step
$$
\mathbf{L^{-1}w}=\mathbf{y}
$$
and as soon as we have \( \mathbf{y} \) we can obtain \( \mathbf{x} \)
through \( \mathbf{Ux}=\mathbf{y} \).
For our four-dimentional example this takes the form
$$
\begin{align}
y_1=&w_1 \nonumber\\
l_{21}y_1 + y_2=&w_2\nonumber \\
l_{31}y_1 + l_{32}y_2 + y_3 =&w_3\nonumber \\
l_{41}y_1 + l_{42}y_2 + l_{43}y_3 + y_4=&w_4. \nonumber
\end{align}
$$
and
$$
\begin{align}
u_{11}x_1 +u_{12}x_2 +u_{13}x_3 + u_{14}x_4=&y_1 \nonumber\\
u_{22}x_2 + u_{23}x_3 + u_{24}x_4=&y_2\nonumber \\
u_{33}x_3 + u_{34}x_4=&y_3\nonumber \\
u_{44}x_4=&y_4 \nonumber
\end{align}
$$
This example shows the basis for the algorithm needed to solve the set of \( n \) linear equations.
The algorithm goes as follows
ludcmp(double a, int n, int indx, double &d)
. This functions returns the LU decomposed matrix \( \bf A \), its determinant and the vector indx which keeps track of the number of interchanges of rows. If the determinant is zero, the solution is malconditioned.lubksb(double a, int n, int indx, double w)
which uses the LU decomposed matrix \( \bf A \) and the vector \( \bf w \) and returns \( \bf x \) in the same place as \( \bf w \). Upon exit the original content in \( \bf w \) is destroyed. If you wish to keep this information, you should make a backup of it in your calling function.If the inverse exists then
$$
\mathbf{A}^{-1}\mathbf{A}=\mathbf{I},
$$
the identity matrix. With an LU decomposed matrix we can rewrite the last equation as
$$
\mathbf{LU}\mathbf{A}^{-1}=\mathbf{I}.
$$
If we assume that the first column (that is column 1) of the inverse matrix can be written as a vector with unknown entries
$$
\mathbf{A}_1^{-1}= \begin{bmatrix}
a_{11}^{-1} \\
a_{21}^{-1} \\
\dots \\
a_{n1}^{-1} \\
\end{bmatrix},
$$
then we have a linear set of equations
$$
\mathbf{LU}\begin{bmatrix}
a_{11}^{-1} \\
a_{21}^{-1} \\
\dots \\
a_{n1}^{-1} \\
\end{bmatrix} =\begin{bmatrix}
1 \\
0 \\
\dots \\
0 \\
\end{bmatrix}.
$$
In a similar way we can compute the unknow entries of the second column,
$$
\mathbf{LU}\begin{bmatrix}
a_{12}^{-1} \\
a_{22}^{-1} \\
\dots \\
a_{n2}^{-1} \\
\end{bmatrix}=\begin{bmatrix}
0 \\
1 \\
\dots \\
0 \\
\end{bmatrix},
$$
and continue till we have solved all \( n \) sets of linear equations.
Standard C/C++: fetch the files lib.cpp
and lib.h
. You can make a directory where you store
these files, and eventually its compiled version lib.o. The example here is program1.cpp from chapter 6 and performs the matrix inversion.
// Simple matrix inversion example
#include <iostream>
#include <new>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include "lib.h"
using namespace std;
/* function declarations */
void inverse(double **, int);
void inverse(double **a, int n)
{
int i,j, *indx;
double d, *col, **y;
// allocate space in memory
indx = new int[n];
col = new double[n];
y = (double **) matrix(n, n, sizeof(double));
ludcmp(a, n, indx, &d); // LU decompose a[][]
printf("\n\nLU form of matrix of a[][]:\n");
for(i = 0; i < n; i++) {
printf("\n");
for(j = 0; j < n; j++) {
printf(" a[%2d][%2d] = %12.4E",i, j, a[i][j]);
// find inverse of a[][] by columns
for(j = 0; j < n; j++) {
// initialize right-side of linear equations
for(i = 0; i < n; i++) col[i] = 0.0;
col[j] = 1.0;
lubksb(a, n, indx, col);
// save result in y[][]
for(i = 0; i < n; i++) y[i][j] = col[i];
} //j-loop over columns
// return the inverse matrix in a[][]
for(i = 0; i < n; i++) {
for(j = 0; j < n; j++) a[i][j] = y[i][j];
free_matrix((void **) y); // release local memory
delete [] col;
delete []indx;
} // End: function inverse()
For Fortran users:
PROGRAM matrix
USE constants
USE F90library
IMPLICIT NONE
! The definition of the matrix, using dynamic allocation
REAL(DP), ALLOCATABLE, DIMENSION(:,:) :: a, ainv, unity
! the determinant
REAL(DP) :: d
! The size of the matrix
INTEGER :: n
....
! Allocate now place in heap for a
ALLOCATE ( a(n,n), ainv(n,n), unity(n,n) )
For Fortran users:
WRITE(6,*) ' The matrix before inversion'
WRITE(6,'(3F12.6)') a
ainv=a
CALL matinv (ainv, n, d)
....
! get the unity matrix
unity=MATMUL(ainv,a)
WRITE(6,*) ' The unity matrix'
WRITE(6,'(3F12.6)') unity
! deallocate all arrays
DEALLOCATE (a, ainv, unity)
END PROGRAM matrix
#include <iostream>
#include "armadillo"
using namespace arma;
using namespace std;
int main()
{
mat A = randu<mat>(5,5);
vec b = randu<vec>(5);
A.print("A =");
b.print("b=");
// solve Ax = b
vec x = solve(A,b);
// print x
x.print("x=");
// find LU decomp of A, if needed, P is the permutation matrix
mat L, U;
lu(L,U,A);
// print l
L.print(" L= ");
// print U
U.print(" U= ");
//Check that A = LU
(A-L*U).print("Test of LU decomposition");
return 0;
}
// This program sets up a simple matrix with random values for the matrix elements
// Matrices are always given by upper case variables
#include <iostream>
#include <new>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
using namespace std;
#define ZERO 1.0E-15
/* function declarations */
double ** AllocateMatrix(int, int);
void DeallocateMatrix(double **, int, int);
void MatrixInverse(double **, int);
void WriteMatrix(double **, int);
void MatrixMultiplication(double **, double **, int);
void LUDecomposition(double **, int, int *);
void LUBackwardSubstitution(double **, int, int *, double *);
// Begin main function, reads from terminal mode the dimension
int main(int argc, char *argv[])
{
// Read from terminal the size of the matrix
int n = atoi(argv[1]);
// Memory for matrix to invert and copy of it
double **A = AllocateMatrix(n, n);
double **B = AllocateMatrix(n, n);
// Define period and seed for standard random number generator
double invers_period = 1./RAND_MAX; // initialise the random number generator
srand(time(NULL)); // This produces the so-called seed in MC jargon
// Setting general square matrices with random matrix elements
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++){
double x = double(rand())*invers_period;
A[i][j] = x;
B[i][j] = A[i][j];
}
}
// Write out original matrix
cout << " Initial matrix A:" << endl;
WriteMatrix(A, n);
// calculate and return inverse matrix
MatrixInverse(B, n);
// Write out inverse matrix
cout << "Inverse matrix of A:" << endl;
WriteMatrix(B, n);
// Check that A^-1A = identity matrix
cout << "Check that we get an identity matrix " << endl;
MatrixMultiplication(A,B,n);
return 0;
} // End: function main()
/*
The function MatrixInverse() performs a matrix inversion
of a square matrix a[][] of dimension n.
*/
void MatrixInverse(double **A, int n)
{
// allocate space in memory
int *indx;
double *column;
indx = new int[n];
column = new double[n];
double **Y = AllocateMatrix(n,n);
// Perform the LU decomposition
LUDecomposition(A, n, indx); // LU decompose a[][]
cout << "LU decomposed matrix A:" << endl;
WriteMatrix(A,n);
// find inverse of a[][] by columns
for(int j = 0; j < n; j++) {
// initialize right-side of linear equations
for(int i = 0; i < n; i++) column[i] = 0.0;
column[j] = 1.0;
LUBackwardSubstitution(A, n, indx, column);
// save result in y[][]
for(int i = 0; i < n; i++) Y[i][j] = column[i];
}
// return the inverse matrix in A[][]
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) A[i][j] = Y[i][j];
}
DeallocateMatrix(Y, n, n); // release local memory
delete [] column;
delete []indx;
} // End: function MatrixInverse()
// Allocate memory for a matrix and initialize the elements to zero
double ** AllocateMatrix(int m, int n){
double ** Matrix;
Matrix = new double*[m];
for(int i=0;i<m;i++){
Matrix[i] = new double[n];
for(int j=0;j<m;j++)
Matrix[i][j] = 0.0;
}
return Matrix;
}
// Free memory
void DeallocateMatrix(double ** Matrix, int m, int n){
for(int i=0;i<m;i++)
delete[] Matrix[i];
delete[] Matrix;
}
// Write out a given matrix
void WriteMatrix(double ** Matrix, int n){
for(int i=0;i < n;i++){
cout << endl;
for (int j=0 ; j < n;j++){
printf(" A[%2d][%2d] = %12.4E",i, j, Matrix[i][j]);
}
}
cout << endl;
}
// Straightforward matrix-matrix multiplication
void MatrixMultiplication(double ** a, double **b, int n){
double **c = AllocateMatrix(n, n);
for(int i=0;i < n;i++){
for (int j=0 ; j < n;j++){
double sum = 0.0;
for (int k = 0; k < n; k++) sum += a[i][k]*b[k][j];
c[i][j] = sum;
}
}
WriteMatrix(c,n);
}
/*
The function
void LUDecomposition(double **a, int n, int *indx)
takes as input a two-dimensional matrix a[][] of dimension n and
replaces it by the LU decomposition of a rowwise permutation of
itself. The results is stored in a[][]
The vector
indx[] records the row permutation effected by the partial pivoting.
*/
void LUDecomposition(double **a, int n, int *indx)
{
int i, imax, j, k;
double big, dum, sum, temp, *vv;
vv = new double [n];
for(i = 0; i < n; i++) { // loop over rows to get scaling information
big = ZERO;
for(j = 0; j < n; j++) {
if((temp = fabs(a[i][j])) > big) big = temp;
}
if(big == ZERO) {
printf("\n\nSingular matrix in routine ludcmp()\n");
exit(1);
}
vv[i] = 1.0/big;
}
for(j = 0; j < n; j++) { // loop over columns of Crout's method
for(i = 0; i< j; i++) { // not i = j
sum = a[i][j];
for(k = 0; k < i; k++) sum -= a[i][k]*a[k][j];
a[i][j] = sum;
}
big = ZERO; // initialization for search for largest pivot element
for(i = j; i< n; i++) {
sum = a[i][j];
for(k = 0; k < j; k++) sum -= a[i][k]*a[k][j];
a[i][j] = sum;
if((dum = vv[i]*fabs(sum)) >= big) {
big = dum;
imax = i;
}
} // end i-loop
if(j != imax) { // do we need to interchange rows ?
for(k = 0;k< n; k++) { // yes
dum = a[imax][k];
a[imax][k] = a[j][k];
a[j][k] = dum;
}
vv[imax] = vv[j]; // also interchange scaling factor
}
indx[j] = imax;
if(fabs(a[j][j]) < ZERO) a[j][j] = ZERO;
if(j < (n - 1)) { // divide by pivot element
dum = 1.0/a[j][j];
for(i=j+1;i < n; i++) a[i][j] *= dum;
}
} // end j-loop over columns
delete [] vv; // release local memory
}
/*
The function
void LUBackwardSubstitution(double **a, int n, int *indx, double *b)
solves the set of linear equations A X = B of dimension n.
a[][] is input, not as the matrix A[][] but rather as
its LU decomposition, indx[] is input as the permutation vector returned by
ludcmp(). b[] is input as the right-hand side vector B,
The solution X is returned in B. The input data a[][],
n and indx[] are not modified. This routine takes into
account the possibility that b[] will begin with many
zero elements, so it is efficient for use in matrix
inversion.
*/
void LUBackwardSubstitution(double **a, int n, int *indx, double *b)
{
int i, ii = -1, ip, j;
double sum;
for(i = 0; i< n; i++) {
ip = indx[i];
sum = b[ip];
b[ip] = b[i];
if(ii > -1) for(j = ii; j < i; j++) sum -= a[i][j] * b[j];
else if(sum) ii = i;
b[i] = sum;
}
for(i = n - 1; i >= 0; i--) {
sum = b[i];
for(j = i+1; j < n; j++) sum -= a[i][j] * b[j];
b[i] = sum/a[i][i];
}
}
It is a simple method for solving
$$
\mathbf{A}\mathbf{x}=\mathbf{b},
$$
where \( \mathbf{A} \) is a matrix and \( \mathbf{x} \) and \( \mathbf{b} \) are vectors. The vector \( \mathbf{x} \) is
the unknown.
It is an iterative scheme where we start with a guess for the unknown, and after \( k+1 \) iterations we have
$$
\mathbf{x}^{(k+1)}= \mathbf{D}^{-1}(\mathbf{b}-(\mathbf{L}+\mathbf{U})\mathbf{x}^{(k)}),
$$
with \( \mathbf{A}=\mathbf{D}+\mathbf{U}+\mathbf{L} \) and
\( \mathbf{D} \) being a diagonal matrix, \( \mathbf{U} \) an upper triangular matrix and \( \mathbf{L} \) a lower triangular
matrix.
If the matrix \( \mathbf{A} \) is positive definite or diagonally dominant, one can show that this method will always converge to the exact solution.
We can demonstrate Jacobi's method by this \( 4\times 4 \) matrix problem. We assume a guess for the vector elements \( x_i^{(0)} \), a guess which represents our first iteration. The new values are obtained by substitution
$$
\begin{align}
x_1^{(1)} =&(b_1-a_{12}x_2^{(0)} -a_{13}x_3^{(0)} - a_{14}x_4^{(0)})/a_{11} \nonumber \\
x_2^{(1)} =&(b_2-a_{21}x_1^{(0)} - a_{23}x_3^{(0)} - a_{24}x_4^{(0)})/a_{22} \nonumber \\
x_3^{(1)} =&(b_3- a_{31}x_1^{(0)} -a_{32}x_2^{(0)} -a_{34}x_4^{(0)})/a_{33} \nonumber \\
x_4^{(1)}=&(b_4-a_{41}x_1^{(0)} -a_{42}x_2^{(0)} - a_{43}x_3^{(0)})/a_{44}, \nonumber
\end{align}
$$
which after \( k+1 \) iterations reads
$$
\begin{align}
x_1^{(k+1)} =&(b_1-a_{12}x_2^{(k)} -a_{13}x_3^{(k)} - a_{14}x_4^{(k)})/a_{11} \nonumber \\
x_2^{(k+1)} =&(b_2-a_{21}x_1^{(k)} - a_{23}x_3^{(k)} - a_{24}x_4^{(k)})/a_{22} \nonumber \\
x_3^{(k+1)} =&(b_3- a_{31}x_1^{(k)} -a_{32}x_2^{(k)} -a_{34}x_4^{(k)})/a_{33} \nonumber \\
x_4^{(k+1)}=&(b_4-a_{41}x_1^{(k)} -a_{42}x_2^{(k)} - a_{43}x_3^{(k)})/a_{44}, \nonumber
\end{align}
$$
We can generalize the above equations to
$$
x_i^{(k+1)}=(b_i-\sum_{j=1, j\ne i}^{n}a_{ij}x_j^{(k)})/a_{ii}
$$
or in an even more compact form as
$$ \mathbf{x}^{(k+1)}= \mathbf{D}^{-1}(\mathbf{b}-(\mathbf{L}+\mathbf{U})\mathbf{x}^{(k)}),
$$
with \( \mathbf{A}=\mathbf{D}+\mathbf{U}+\mathbf{L} \) and
\( \mathbf{D} \) being a diagonal matrix, \( \mathbf{U} \) an upper triangular matrix and \( \mathbf{L} \) a lower triangular
matrix.
Our \( 4\times 4 \) matrix problem
$$
\begin{align}
x_1^{(k+1)} =&(b_1-a_{12}x_2^{(k)} -a_{13}x_3^{(k)} - a_{14}x_4^{(k)})/a_{11} \nonumber \\
x_2^{(k+1)} =&(b_2-a_{21}x_1^{(k)} - a_{23}x_3^{(k)} - a_{24}x_4^{(k)})/a_{22} \nonumber \\
x_3^{(k+1)} =&(b_3- a_{31}x_1^{(k)} -a_{32}x_2^{(k)} -a_{34}x_4^{(k)})/a_{33} \nonumber \\
x_4^{(k+1)}=&(b_4-a_{41}x_1^{(k)} -a_{42}x_2^{(k)} - a_{43}x_3^{(k)})/a_{44}, \nonumber
\end{align}
$$
can be rewritten as
$$
\begin{align}
x_1^{(k+1)} =&(b_1-a_{12}x_2^{(k)} -a_{13}x_3^{(k)} - a_{14}x_4^{(k)})/a_{11} \nonumber \\
x_2^{(k+1)} =&(b_2-a_{21}x_1^{(k+1)} - a_{23}x_3^{(k)} - a_{24}x_4^{(k)})/a_{22} \nonumber \\
x_3^{(k+1)} =&(b_3- a_{31}x_1^{(k+1)} -a_{32}x_2^{(k+1)} -a_{34}x_4^{(k)})/a_{33} \nonumber \\
x_4^{(k+1)}=&(b_4-a_{41}x_1^{(k+1)} -a_{42}x_2^{(k+1)} - a_{43}x_3^{(k+1)})/a_{44}, \nonumber
\end{align}
$$
which allows us to utilize the preceding solution (forward substitution). This improves normally the convergence
behavior and leads to the Gauss-Seidel method!
We can generalize
$$
\begin{align}
x_1^{(k+1)} =&(b_1-a_{12}x_2^{(k)} -a_{13}x_3^{(k)} - a_{14}x_4^{(k)})/a_{11} \nonumber \\
x_2^{(k+1)} =&(b_2-a_{21}x_1^{(k+1)} - a_{23}x_3^{(k)} - a_{24}x_4^{(k)})/a_{22} \nonumber \\
x_3^{(k+1)} =&(b_3- a_{31}x_1^{(k+1)} -a_{32}x_2^{(k+1)} -a_{34}x_4^{(k)})/a_{33} \nonumber \\
x_4^{(k+1)}=&(b_4-a_{41}x_1^{(k+1)} -a_{42}x_2^{(k+1)} - a_{43}x_3^{(k+1)})/a_{44}, \nonumber
\end{align}
$$
to the following form
$$
x^{(k+1)}_i = \frac{1}{a_{ii}} \left(b_i - \sum_{j > i}a_{ij}x^{(k)}_j - \sum_{j < i}a_{ij}x^{(k+1)}_j \right),\quad i=1,2,\ldots,n.
$$
The procedure is generally continued until the changes made by an iteration are below some tolerance.
The convergence properties of the Jacobi method and the Gauss-Seidel method are dependent on the matrix \( \mathbf{A} \). These methods converge when the matrix is symmetric positive-definite, or is strictly or irreducibly diagonally dominant. Both methods sometimes converge even if these conditions are not satisfied.
Given a square system of n linear equations with unknown \( \mathbf x \):
$$
\mathbf{A}\mathbf x = \mathbf b
$$
where
$$
\mathbf{A}=\begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\a_{n1} & a_{n2} & \cdots & a_{nn} \end{bmatrix}, \qquad \mathbf{x} = \begin{bmatrix} x_{1} \\ x_2 \\ \vdots \\ x_n \end{bmatrix} , \qquad \mathbf{b} = \begin{bmatrix} b_{1} \\ b_2 \\ \vdots \\ b_n \end{bmatrix}.
$$
Then A can be decomposed into a diagonal component D, and strictly lower and upper triangular components L and U:
$$
\mathbf{A} =\mathbf{D} + \mathbf{L} + \mathbf{U},
$$
where
$$
D = \begin{bmatrix} a_{11} & 0 & \cdots & 0 \\ 0 & a_{22} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\0 & 0 & \cdots & a_{nn} \end{bmatrix}, \quad L = \begin{bmatrix} 0 & 0 & \cdots & 0 \\ a_{21} & 0 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\a_{n1} & a_{n2} & \cdots & 0 \end{bmatrix}, \quad U = \begin{bmatrix} 0 & a_{12} & \cdots & a_{1n} \\ 0 & 0 & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\0 & 0 & \cdots & 0 \end{bmatrix}.
$$
The system of linear equations may be rewritten as:
$$
(D+\omega L) \mathbf{x} = \omega \mathbf{b} - [\omega U + (\omega-1) D ] \mathbf{x}
$$
for a constant \( \omega > 1 \).
The method of successive over-relaxation is an iterative technique that solves the left hand side of this expression for \( x \), using previous value for \( x \) on the right hand side. Analytically, this may be written as:
$$
\mathbf{x}^{(k+1)} = (D+\omega L)^{-1} \big(\omega \mathbf{b} - [\omega U + (\omega-1) D ] \mathbf{x}^{(k)}\big).
$$
However, by taking advantage of the triangular form of \( (D+\omega L) \), the elements of \( x^{(k+1)} \) can be computed sequentially using forward substitution:
$$
x^{(k+1)}_i = (1-\omega)x^{(k)}_i + \frac{\omega}{a_{ii}} \left(b_i - \sum_{j > i} a_{ij}x^{(k)}_j - \sum_{j < i} a_{ij}x^{(k+1)}_j \right),\quad i=1,2,\ldots,n.
$$
The choice of relaxation factor is not necessarily easy, and depends upon the properties of the coefficient matrix. For symmetric, positive-definite matrices it can be proven that \( 0 < \omega < 2 \) will lead to convergence, but we are generally interested in faster convergence rather than just convergence.
Cubic spline interpolation is among one of the most used methods for interpolating between data points where the arguments are organized as ascending series. In the library program we supply such a function, based on the so-called cubic spline method to be described below.
A spline function consists of polynomial pieces defined on subintervals. The different subintervals are connected via various continuity relations.
Assume we have at our disposal \( n+1 \) points \( x_0, x_1, \dots x_n \) arranged so that \( x_0 < x_1 < x_2 < \dots x_{n-1} < x_n \) (such points are called knots). A spline function \( s \) of degree \( k \) with \( n+1 \) knots is defined as follows
As an example, consider a spline function of degree \( k=1 \) defined as follows
$$
s(x)=\begin{bmatrix} s_0(x)=a_0x+b_0 & x\in [x_0, x_1) \\
s_1(x)=a_1x+b_1 & x\in [x_1, x_2) \\
\dots & \dots \\
s_{n-1}(x)=a_{n-1}x+b_{n-1} & x\in
[x_{n-1}, x_n] \end{bmatrix}.
$$
In this case the polynomial consists of series of straight lines
connected to each other at every endpoint. The number of continuous
derivatives is then \( k-1=0 \), as expected when we deal with straight lines.
Such a polynomial is quite easy to construct given
\( n+1 \) points \( x_0, x_1, \dots x_n \) and their corresponding
function values.
The most commonly used spline function is the one with \( k=3 \), the so-called cubic spline function. Assume that we have in adddition to the \( n+1 \) knots a series of functions values \( y_0=f(x_0), y_1=f(x_1), \dots y_n=f(x_n) \). By definition, the polynomials \( s_{i-1} \) and \( s_i \) are thence supposed to interpolate the same point \( i \), that is
$$
s_{i-1}(x_i)= y_i = s_i(x_i),
$$
with \( 1 \le i \le n-1 \). In total we have \( n \) polynomials of the
type
$$
s_i(x)=a_{i0}+a_{i1}x+a_{i2}x^2+a_{i2}x^3,
$$
yielding \( 4n \) coefficients to determine.
Every subinterval provides in addition the \( 2n \) conditions
$$
y_i = s(x_i),
$$
and
$$
s(x_{i+1})= y_{i+1},
$$
to be fulfilled. If we also assume that \( s' \) and \( s'' \) are continuous,
then
$$
s'_{i-1}(x_i)= s'_i(x_i),
$$
yields \( n-1 \) conditions. Similarly,
$$
s''_{i-1}(x_i)= s''_i(x_i),
$$
results in additional \( n-1 \) conditions. In total we have \( 4n \) coefficients
and \( 4n-2 \) equations to determine them, leaving us with \( 2 \) degrees of
freedom to be determined.
Using the last equation we define two values for the second derivative, namely
$$
s''_{i}(x_i)= f_i,
$$
and
$$
s''_{i}(x_{i+1})= f_{i+1},
$$
and setting up a straight line between \( f_i \) and \( f_{i+1} \) we have
$$
s_i''(x) = \frac{f_i}{x_{i+1}-x_i}(x_{i+1}-x)+
\frac{f_{i+1}}{x_{i+1}-x_i}(x-x_i),
$$
and integrating twice one obtains
$$
s_i(x) = \frac{f_i}{6(x_{i+1}-x_i)}(x_{i+1}-x)^3+
\frac{f_{i+1}}{6(x_{i+1}-x_i)}(x-x_i)^3
+c(x-x_i)+d(x_{i+1}-x).
$$
Using the conditions \( s_i(x_i)=y_i \) and \( s_i(x_{i+1})=y_{i+1} \) we can in turn determine the constants \( c \) and \( d \) resulting in
$$
\begin{align}
s_i(x) =&\frac{f_i}{6(x_{i+1}-x_i)}(x_{i+1}-x)^3+
\frac{f_{i+1}}{6(x_{i+1}-x_i)}(x-x_i)^3 \nonumber \\
+&(\frac{y_{i+1}}{x_{i+1}-x_i}-\frac{f_{i+1}(x_{i+1}-x_i)}{6})
(x-x_i)+
(\frac{y_{i}}{x_{i+1}-x_i}-\frac{f_{i}(x_{i+1}-x_i)}{6})
(x_{i+1}-x).
\tag{19}
\end{align}
$$
How to determine the values of the second derivatives \( f_{i} \) and \( f_{i+1} \)? We use the continuity assumption of the first derivatives
$$
s'_{i-1}(x_i)= s'_i(x_i),
$$
and set \( x=x_i \). Defining \( h_i=x_{i+1}-x_i \) we obtain finally
the following expression
$$
h_{i-1}f_{i-1}+2(h_{i}+h_{i-1})f_i+h_if_{i+1}=
\frac{6}{h_i}(y_{i+1}-y_i)-\frac{6}{h_{i-1}}(y_{i}-y_{i-1}),
$$
and introducing the shorthands \( u_i=2(h_{i}+h_{i-1}) \),
\( v_i=\frac{6}{h_i}(y_{i+1}-y_i)-\frac{6}{h_{i-1}}(y_{i}-y_{i-1}) \),
we can reformulate the problem as a set of linear equations to be
solved through e.g., Gaussian elemination
Gaussian elimination
$$
\begin{bmatrix} u_1 & h_1 &0 &\dots & & & & \\
h_1 & u_2 & h_2 &0 &\dots & & & \\
0 & h_2 & u_3 & h_3 &0 &\dots & & \\
\dots& & \dots &\dots &\dots &\dots &\dots & \\
&\dots & & &0 &h_{n-3} &u_{n-2} &h_{n-2} \\
& && & &0 &h_{n-2} &u_{n-1} \end{bmatrix}
\begin{bmatrix} f_1 \\
f_2 \\
f_3\\
\dots \\
f_{n-2} \\
f_{n-1} \end{bmatrix} =
\begin{bmatrix} v_1 \\
v_2 \\
v_3\\
\dots \\
v_{n-2}\\
v_{n-1} \end{bmatrix}.
$$
Note that this is a set of tridiagonal equations and can be solved
through only \( O(n) \) operations.
The functions supplied in the program library are spline and splint. In order to use cubic spline interpolation you need first to call
spline(double x[], double y[], int n, double yp1, double yp2, double y2[])
This function takes as input \( x[0,..,n - 1] \) and \( y[0,..,n - 1] \) containing a tabulation \( y_i = f(x_i) \) with \( x_0 < x_1 < .. < x_{n - 1} \) together with the first derivatives of \( f(x) \) at \( x_0 \) and \( x_{n-1} \), respectively. Then the function returns \( y2[0,..,n-1] \) which contains the second derivatives of \( f(x_i) \) at each point \( x_i \). \( n \) is the number of points. This function provides the cubic spline interpolation for all subintervals and is called only once.
Thereafter, if you wish to make various interpolations, you need to call the function
splint(double x[], double y[], double y2a[], int n, double x, double *y)
which takes as input the tabulated values \( x[0,..,n - 1] \) and \( y[0,..,n - 1] \) and the output y2a[0,..,n - 1] from spline. It returns the value \( y \) corresponding to the point \( x \).


cf.cfdm.write¶
-
cf.cfdm.
write
(fields, filename, fmt='NETCDF4', overwrite=True, global_attributes=None, variable_attributes=None, file_descriptors=None, external=None, Conventions=None, datatype=None, least_significant_digit=None, endian='native', compress=0, fletcher32=False, shuffle=True, verbose=False, _implementation=<CFDMImplementation: >)¶ Write field constructs to a netCDF file.
File format
See the fmt parameter for details on which output netCDF file formats are supported.
NetCDF variable and dimension names
These names are stored within constructs read a from dataset, or may be set manually. They are used when writing a field construct to the file. If a name has not been set then one will be constructed (usually based on the standard name if it exists). The names may be modified internally to prevent duplication in the file.
Each construct, or construct component, that corresponds to a netCDF variable has the following methods to get, set and remove a netCDF variable name:
nc_get_variable
,nc_set_variable
andnc_del_variable
methodThe domain axis construct has the following methods to get, set and remove a netCDF dimension name:
nc_get_dimension
,nc_set_dimension
andnc_del_dimension
.NetCDF attributes
Field construct properties may be written as netCDF global attributes and/or netCDF data variable attributes. See the file_descriptors, global_attributes and variable_attributes parameters for details.
External variables
Metadata constructs marked as external are omitted from the file and referred to via the netCDF “external_variables” global attribute. However, omitted constructs may be written to an external file (see the external parameter for details).
NetCDF unlimited dimensions
Domain axis constructs will be written as netCDF unlimited dimensions may be accessed with the
nc_unlimited_dimensions
nc_set_unlimited_dimensions
andnc_clear_unlimited_dimensions
methods of a field construct.NetCDF4 HDF chunk sizes
HDF5 chunksizes may be set on contruct’s data. See the
nc_hdf5_chunksizes
,nc_clear_hdf5_chunksizes
andnc_set_hdf5_chunksizes
metods of aData
instance.New in version 1.7.0.
See also
cfdm.read
Parameters: - fields: (sequence of)
Field
The field constructs to write to the file.
- filename:
str
The output netCDF file name. Various type of expansion are applied to the file names.
Relative paths are allowed, and standard tilde and shell parameter expansions are applied to the string.
- Parameter example:
The file
file.nc
in the user’s home directory could be described by any of the following:'$HOME/file.nc'
,'${HOME}/file.nc'
,'~/file.nc'
,'~/tmp/../file.nc'
.
- fmt:
str
, optional The format of the output file. One of:
fmt Output file type 'NETCDF4'
NetCDF4 format file. This is the default. 'NETCDF4_CLASSIC'
NetCDF4 classic format file (see below) 'NETCDF3_CLASSIC'
NetCDF3 classic format file (limited to file sizes less than 2GB). 'NETCDF3_64BIT_OFFSET'
NetCDF3 64-bit offset format file 'NETCDF3_64BIT'
An alias for 'NETCDF3_64BIT_OFFSET'
'NETCDF3_64BIT_DATA'
NetCDF3 64-bit offset format file with extensions (see below) By default the format is
'NETCDF4'
.All formats support large files (i.e. those greater than 2GB) except
'NETCDF3_CLASSIC'
.'NETCDF3_64BIT_DATA'
is a format that requires version 4.4.0 or newer of the C library (usecfdm.environment
to see which version if the netCDF-C library is in use). It extends the'NETCDF3_64BIT_OFFSET'
binary format to allow for unsigned/64 bit integer data types and 64-bit dimension sizes.'NETCDF4_CLASSIC'
files use the version 4 disk format (HDF5), but omits features not found in the version 3 API. They can be read by HDF5 clients. They can also be read by netCDF3 clients only if they have been re-linked against the netCDF4 library.'NETCDF4'
files use the version 4 disk format (HDF5) and use the new features of the version 4 API.- overwrite:
bool
, optional If False then raise an error if the output file pre-exists. By default a pre-existing output file is overwritten.
- Conventions: (sequence of)
str
, optional Specify conventions to be recorded by the netCDF global “Conventions” attribute. By default the current conventions are always included, but if an older CF conventions is defined then this is used instead.
- Parameter example:
Conventions='UGRID-1.0'
- Parameter example:
Conventions=['UGRID-1.0']
- Parameter example:
Conventions=['CMIP-6.2', 'UGRID-1.0']
- Parameter example:
Conventions='CF-1.7'
- Parameter example:
Conventions=['CF-1.7', 'UGRID-1.0']
Note that if the “Conventions” property is set on a field construct then it is ignored.
- file_descriptors:
dict
, optional Create description of file contents netCDF global attributes from the specified attributes and their values.
If any field construct has a property with the same name then it will be written as a netCDF data variable attribute, even if it has been specified by the global_attributes parameter, or has been flagged as global on any of the field constructs (see
cfdm.Field.nc_global_attributes
for details).Identification of the conventions being adhered to by the file are not specified as a file descriptor, but by the Conventions parameter instead.
- Parameter example:
file_attributes={'title': 'my data'}
- Parameter example:
file_attributes={'history': 'created 2019-01-01', 'foo': 'bar'}
- global_attributes: (sequence of)
str
, optional Create netCDF global attributes from the specified field construct properties, rather than netCDF data variable attributes.
These attributes are in addition to the following field construct properties, which are created as netCDF global attributes by default:
- the description of file contents properties (as defined by the CF conventions), and
- properties flagged as global on any of the field
constructs being written (see
cfdm.Field.nc_global_attributes
for details).
Note that it is not possible to create a netCDF global attribute from a property that has different values for different field constructs being written. In this case the property will not be written as a netCDF global attribute, even if it has been specified by the global_attributes parameter or is one of the default properties, but will appear as an attribute on the netCDF data variable corresponding to each field construct that contains the property.
Any global attributes that are also specified as file descriptors will not be written as netCDF global variables, but as netCDF data variable attributes instead.
- Parameter example:
global_attributes='project'
- Parameter example:
global_attributes=['project']
- Parameter example:
global_attributes=['project', 'experiment']
- variable_attributes: (sequence of)
str
, optional Create netCDF data variable attributes from the specified field construct properties.
By default, all field construct properties that are not created as netCDF global properties are created as attributes netCDF data variables. See the global_attributes parameter for details.
Any field construct property named by the variable_attributes parameter will always be created as a netCDF data variable attribute
- Parameter example:
variable_attributes='project'
- Parameter example:
variable_attributes=['project']
- Parameter example:
variable_attributes=['project', 'doi']
- external:
str
, optional Write metadata constructs that have data and are marked as external to the named external file. Ignored if there are no such constructs.
- datatype:
dict
, optional Specify data type conversions to be applied prior to writing data to disk. This may be useful as a means of packing, or because the output format does not support a particular data type (for example, netCDF3 classic files do not support 64-bit integers). By default, input data types are preserved. Any data type conversion is only applied to the arrays on disk, and not to the input field constructs themselves.
Data types conversions are defined by
numpy.dtype
objects in a dictionary whose keys are input data types with values of output data types.- Parameter example:
To convert 64-bit integers to 32-bit integers:
datatype={numpy.dtype('int64'): numpy.dtype('int32')}
.
- endian:
str
, optional The endian-ness of the output file. Valid values are
'little'
,'big'
or'native'
. By default the output is native endian. See the netCDF4 package for more details.- Parameter example:
endian='big'
- compress:
int
, optional Regulate the speed and efficiency of compression. Must be an integer between
0
and9
.0
means no compression;1
is the fastest, but has the lowest compression ratio;9
is the slowest but best compression ratio. The default value is0
. An error is raised if compression is requested for a netCDF3 output file format. See the netCDF4 package for more details.- Parameter example:
compress=4
- least_significant_digit:
int
, optional Truncate the input field construct data arrays, but not the data arrays of metadata constructs. For a given positive integer, N the precision that is retained in the compressed data is 10 to the power -N. For example, a value of 2 will retain a precision of 0.01. In conjunction with the compress parameter this produces ‘lossy’, but significantly more efficient, compression. See the netCDF4 package for more details.
- Parameter example:
least_significant_digit=3
- fletcher32:
bool
, optional If True then the Fletcher-32 HDF5 checksum algorithm is activated to detect compression errors. Ignored if compress is
0
. See the netCDF4 package for details.- shuffle:
bool
, optional If True (the default) then the HDF5 shuffle filter (which de-interlaces a block of data before compression by reordering the bytes by storing the first byte of all of a variable’s values in the chunk contiguously, followed by all the second bytes, and so on) is turned off. By default the filter is applied because if the data array values are not all wildly different, using the filter can make the data more easily compressible. Ignored if the compress parameter is
0
(which is its default value). See the netCDF4 package for more details.- verbose:
bool
, optional If True then print a summary of how constructs map to output netCDF dimensions, variables and attributes.
- _implementation: (subclass of)
CFDMImplementation
, optional Define the CF data model implementation that defines field and metadata constructs and their components.
Returns: Examples:
>>> cfdm.write(f, 'file.nc')
>>> cfdm.write(f, 'file.nc', fmt='NETCDF3_CLASSIC')
>>> cfdm.write(f, 'file.nc', external='cell_measures.nc')
>>> cfdm.write(f, 'file.nc', Conventions='CMIP-6.2')
- fields: (sequence of)


The example server code sample provides a basic example of how you can integrate tru.ID into a back-end Node.js server where the back-end is effectively middleware that ensures the client can be trusted and that the API calls to the tru.ID API are authenticated.
It exposes the following routes as examples:
POST /phone-check
GET /phone-check
POST /phone-check/callback
POST /subscriber-check
GET /subscriber-check
The tru.ID SIMCheck API provides information on when a SIM card associated with a mobile phone number was last changed. This can be used when augmenting existing 2FA or anti-fraud workflows.
POST /sim-check
The tru.ID Coverage API provides two endpoints exposing reachability information for the platform and devices.
GET /countries/{country_code}
GET /device_ips/{ip}
A helper API to get the IP Address of a device. This is not a tru.ID API).
GET /my-ip
Example response:
{
"ip_address": "<IP_ADDRESS>"
}
The following pages allow you to test out some of the functionality.


Web is a collection of internet pages. Pages is made from HTML. Users send requests to servers which store pages. Contents of HTML include hyper links, text, images and links to other pages. 30 billions pages.
2.Making HTMLTags or elements are marks that tell computer to display contents in certain way. 2 types of tags are inline and block. Inline ignores whitespace;block put content in a box. Format is < tag_name> content < /tag_name> Arrtributes are used within the tag to make specifications.
3.Example< a href = "http://www.rogerfederer.com"> link < /a> append this link


Israel's attorney general, a Netanyahu appointee, turns accuser
Discreet but influential - and hand-picked to his role by Prime Minister Benjamin Netanyahu - Avichai Mandelblit has become the first attorney general in Israeli history to indict a serving premier.
Standing in front of two Israeli flags, the grey-bearded 56-year-old struck a solemn tone on Thursday as he read out bribery, fraud and breach of trust charges against Netanyahu.
He said the decision to indict was made "with a heavy heart but with a whole heart."
Born in Tel Aviv to a right-wing family, Mandelblit is an Orthodox Jew and has six children.
He was nominated as attorney general by Netanyahu in 2016, and could become responsible for bringing down the country's longest-serving premier.
Well respected and quietly influential, he served under Netanyahu as cabinet secretary until 2015, working alongside the premier on a daily basis.
Before stepping into government roles, he was a senior lawyer for the Israeli army.
In 2004, he was named as chief military advocate general and promoted to general five years later.
In that strategic post, he was criticised by right-wingers for conducting investigations against Israeli soldiers suspected of abuses during a 2008-9 war in Gaza.
In 2014, after he had left the army, he was implicated in the so-called Harpaz affair, named after an officer convicted of producing false documents to influence the appointment of the army's chief of staff.
The investigation into Mandelblit was dropped, with no indictment brought.
Target of anger
Mandelblit has faced a near impossible challenge as attorney general.
The role stipulates that he represent the government in all legal cases and work alongside Netanyahu.
Yet shortly after the attorney general took office, the Israeli police detailed their suspicions over three cases, the most serious of which involves Netanyahu allegedly offering to change regulatory policies in exchange for favourable coverage from a media outlet.
He therefore faced the task of deciding whether or not to charge his "boss."
The case has made him a target of anger for many Netanyahu supporters.
Announcing his much anticipated decision Thursday, Mandelblit said it was a "hard and sad day" for Israel to indict a leader.
"The citizens of Israel, all of us, and myself, look up to the elected officials, and first and foremost to the prime minister," Mandelblit said.
"Law enforcement is not a choice. It is not a matter of right or left. It's not a matter of politics."
Refusing to answer questions or give interviews, Mandelblit remains an enigma for many commentators who speculate on his political inclinations.
But after being thrust into the spotlight, the world is now aware that the unassuming figure has become one of Israel's most important decision makers.


{% block body %}
The license for {% for item in licenseinfo %} {{item[1]}}{% endfor %} with Registration Number {% for item in licenseinfo %}{{item[13]}}{% endfor %} located at {% for item in licenseinfo %}{{item[5]}}{% endfor %} having satisfied the condition for operation has been approved on {% for item in licenseinfo %} {{item[14]}} {% endfor %}. The Company Chief Executive Officer in person of {% for item in licenseinfo %} {{item[12]}} {% endfor %} should come to the Liberia Revenue Authority Headquarter Office for collection of original License Certificate for operation by coming with this document with original prove of identity as the CEO of the company. Once again, on behalf of the Liberia Revenue Authority Congratulation


home
linkedIn
Register User
{0}
Username
Password
First Name
Last Name
Age
What do you want to do?
Play a Sport?
Hit the Gym?


A crowdfunding campaign can't survive on just words alone. Add images that are related to the cause you're raising money for. This helps donors connect to your cause and see what their donations are going towards.
Upload documents such as letters, medical reports.


Tutorial
You can search data in 2 different ways. The first is by entering a search term in the general search bar. This will return matches that contain your search query in either the datasource name, schema name, table name, or column name. The second way to search is by using the Advanced search, located under the intial search bar. This will open up the advanced search modal allowing you to search on multiple fields at once. You can choose how many results you would like to view at once by changing the top right option to 10, 25, 50, or 100. 'Export Results' will download a csv file that contains all of the data returned by your query. Clicking on the drop down arrow on the futhermost left point of any row will show more in-depth data about each row, such as current classification, who created it, it will allow deletion of the row, and you can also change the current classification using the drop-down. Multi-editing is enabled as well. Simply ctrl + click to select multiple rows individually, or hold shift and click to select multiple consecutive rows at once. Once you have selected all of the rows you wish to edit click 'Edit Selected' on the bottom of the page. This will then allow you to choose the desired classification of the data. Don't forget to 'Commit Changes' before you leave the page, otherwise changes might be lost.


Geo-F/X is a small consulting firm headed by Richard Wright, Ph.D. specializing in digital publishing with extensive past experience in GIS and high performance graphics.
Ric Wright is currently the Director of Engineering for the Readium Foundation, where he is leading the effort to develop open-source EPUB rendering engines for use in both devices and browsers. The Readium effort is a collaborative engineering effort knitting together more than 70 companies and developers from all over the globe. Ric was also a long-standing member of the International Digital Publishing Foundation (IDPF) working group for EPUB, a role he continues that the IDPF has been merged into the W3C.
Prior to leading the Readium effort, Ric was a senior engineering manager and developer at Adobe Systems of San Jose, California. At Adobe he founded and led the development of Adobe Digital Editions, the Reader Mobile SDK (RMSDK), and Adobe Content Server, the current industry standard for Digital Rights Management (DRM) in eBooks. Ric is also a member of the original IDPF EPUB working group that produced both the the EPUB 2 and 3 specifications. Ric was also instrumental in the development of the W3C standard for scalable vector graphics (SVG) and wrote most of the support in Adobe authoring tools for SVG. He also contributed to the Adobe SVG Viewer Project as a developer.
Ric is the principal at Geo-F/X which specializes in digital publishing and the application of scientific visualization via GIS and OpenGL. Ric holds both a M.Sc. and Ph.D in Earth Science from McGill University, where he also taught earth science for a number of years and founded McGill’s computer cartography lab.


Darshna Girish Sadhnani
- Summer Feelz: Summer is gonna be AMAZING!
With an Internship and CodeU, I'm gonna be doing what I love
everyday :D
It's going to be epic.
- Aspirational Hobby: Watching TV Shows, discovering memes and making new projects
- Ask me About: Anything, I'm an open book.
Danni Li
- Summer Feelz: Awesome to connect with bunch of great peeps ;)
- Aspirational Hobby: Hiking, Hacking & Films
- Ask me About: Find me here!
Trisha Gupta
- Summer Feelz: Really excited and looking forward to CodeU's project along with my internship!
- Aspirational Hobby: Love meeting new people, reading about new technologies and travelling!


Add New Class
Add a New Class
Class Code
Class Number
Clicking OK below will generate a new gradebook for the class entered above.
OK
Cancel


| 1. Check your details | task status |
|---|---|
| Your contact details | |
| Your site codes |
| 2.  Check and submit your report | |
|---|---|
| Share your data | |
| Check your data | |
| Submit your report |


Elisabeth Hendrickson
"Practicing Test Driven Development is much more about setting concrete, detailed expectations in advance, and allowing those expectations of code behavior to guide the implementation than it is about testing."
"In ATDD, the team creates one or more acceptance-level tests for a feature before beginning work on it. Typically these tests are discussed and captured when the team is working with the business stakeholder(s) 1 to understand a story on the backlog.


--- layout: index title: Special STSM tagline: tags : [about, info] img : img-mobile : author : Marcin Koculak css: js: keywords: canonical: --- {% include JB/setup %}
The STSM committee has decided to give special priority to STSMs to participate in joint project activities at the University of Malta from Sept 1 – 21 2021. The primary purpose of the STSMs will be to work jointly on the analysis of data collected at the Action’s first data collection site (Aarhus University), and the primary candidates are thus researchers who are or will be involved in a substantial part of the analysis of that data. This will typically be researchers who aim to publish an article linking data from a particular behavioural experiment to MRI data.
More information on STSMs in general within the Action can be found HERE. To apply, follow the standard procedure and note the special requirements listed in this call. We encourage potential applicants to apply before July 1 2021 as we will process applications around that time and only accept further applications if funding allows.
For questions about applying in general, contact STSM coordinator, Dr Jordi Solé-Casals (jordi.sole [at] uvic.cat).
For questions about the visit, contact local host Dr Claude Bajada (claude.bajada [at] um.edu.mt).
For questions about eligibility or other questions, contact Action Chair Dr Kristian Sandberg (kristian.sandberg [at] clin.au.dk).


Controllers make creating and tearing down event handlers extremely
easy. The tearingdown of event handlers is especially important
in preventing memory leaks in long lived applications.
Automatic Binding
When a [jQuery.Controller.prototype.setup new controller is created],
contoller checks its prototype methods for functions that are named like
event handlers. It binds these functions to the
controller's [jQuery.Controller.prototype.element element] with
event delegation. When
the controller is destroyed (or it's element is removed from the page), controller
will unbind its event handlers automatically.
For example, each of the following controller's functions will automatically
bound:
$.Controller("Crazy",{
// listens to all clicks on this element
"click" : function(el, ev){},
// listens to all mouseovers on
// li elements withing this controller
"li mouseover" : function(el, ev){}
// listens to the window being resized
"{window} resize" : function(window, ev){}
})
Controller will bind function names with spaces, standard DOM events, and
event names in $.event.special.
In general, Controller will know automatically when to bind event handler functions except for
one case - event names without selectors that are not in $.event.special.
But to correct for this, you just need to add the
function to the [jQuery.Controller.static.listensTo listensTo]
property. Here's how:
$.Controller("MyShow",{
listensTo: ["show"]
},{
show: function( el, ev ) {
el.show();
}
})
$('.show').my_show().trigger("show");
Callback parameters
Event handlers bound with controller are called back with the element and the event
as parameters. this refers to the controller instance. For example:
$.Controller("Tabs",{
// li - the list element that was clicked
// ev - the click event
"li click" : function(li, ev){
this.tab(li).hide()
},
tab : function(li){
return $(li.find("a").attr("href"))
}
})
Templated Event Bindings
One of Controller's most powerful features is templated event
handlers. You can parameterize the event name,
the selector, or event the root element.
Templating event names and selectors:
Often, you want to make a widget's behavior
configurable. A common example is configuring which event
a menu should show a sub-menu (ex: on click or mouseenter). The
following controller lets you configure when a menu should show
sub-menus:
The following makes two buttons. One says hello on click,
the other on a 'tap' event.
$.Controller replaces value in {} with
values in a
controller's [jQuery.Controller.prototype.options options]. This means
we can easily provide a default showEvent value and create
a menu without providing a value like:
When looking up a value to replace {},
controller first looks up the item in the options, then it looks
up the value in the window object. It does not use eval to look up the
object. Instead it uses [jQuery.String.getObject].
Subscribing to OpenAjax messages and custom bindings
The jquerypp/controller/subscribe plugin allows controllers to listen
to OpenAjax.hub messages like:
You can create your own binders by adding to [jQuery.Controller.static.processors].
Manually binding to events.
The [jQuery.Controller.prototype.bind] and [jQuery.Controller.prototype.delegate]
methods let you listen to events on other elements. These event handlers will
be unbound when the controller instance is destroyed.
Controllers make creating and tearing down event handlers extremely easy. The tearingdown of event handlers is especially important in preventing memory leaks in long lived applications.
Automatic Binding
When a [jQuery.Controller.prototype.setup new controller is created], contoller checks its prototype methods for functions that are named like event handlers. It binds these functions to the controller's [jQuery.Controller.prototype.element element] with event delegation. When the controller is destroyed (or it's element is removed from the page), controller will unbind its event handlers automatically.
For example, each of the following controller's functions will automatically bound:
Controller will bind function names with spaces, standard DOM events, and event names in $.event.special.
In general, Controller will know automatically when to bind event handler functions except for one case - event names without selectors that are not in $.event.special.
But to correct for this, you just need to add the function to the [jQuery.Controller.static.listensTo listensTo] property. Here's how:
Callback parameters
Event handlers bound with controller are called back with the element and the event as parameters. this refers to the controller instance. For example:
Templated Event Bindings
One of Controller's most powerful features is templated event handlers. You can parameterize the event name, the selector, or event the root element.
Templating event names and selectors:
Often, you want to make a widget's behavior configurable. A common example is configuring which event a menu should show a sub-menu (ex: on click or mouseenter). The following controller lets you configure when a menu should show sub-menus:
The following makes two buttons. One says hello on click, the other on a 'tap' event.
$.Controller replaces value in
{}
with values in a controller's [jQuery.Controller.prototype.options options]. This means we can easily provide a defaultshowEvent
value and create a menu without providing a value like:Sometimes, we might might want to configure our widget to use different elements. The following makes the menu widget's
button
elements configurable:Templating the root element.
Finally, controller lets you bind to objects outside of the [jQuery.Controller.prototype.element controller's element].
The following listens to clicks on the window:
The following listens to Todos being created:
But instead of making NewTodos only work with the Todo model, we can make it configurable:
How Templated events work
When looking up a value to replace
{}
, controller first looks up the item in the options, then it looks up the value in the window object. It does not use eval to look up the object. Instead it uses [jQuery.String.getObject].Subscribing to OpenAjax messages and custom bindings
The jquerypp/controller/subscribe plugin allows controllers to listen to OpenAjax.hub messages like:
You can create your own binders by adding to [jQuery.Controller.static.processors].
Manually binding to events.
The [jQuery.Controller.prototype.bind] and [jQuery.Controller.prototype.delegate] methods let you listen to events on other elements. These event handlers will be unbound when the controller instance is destroyed.


Jeospatial is a simple geospatial point database library for Java. It aims to provide an easy-to-use and reasonably-high-performance set of tools for solving the k-nearest-neighbor problem on the earth's surface.
The jeospatial project is hosted at https://github.com/jchambers/jeospatial. Please use the project page to report any issues with the library or its documentation.


Module: ActionView::Helpers::SanitizeHelper
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Included In:
| |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::ActiveSupport::Concern
|
|
| Defined in: | actionview/lib/action_view/helpers/sanitize_helper.rb |
Overview
The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements. These helper methods extend Action View making them callable within your template files.
Class Method Summary
::ActiveSupport::Concern - Extended
Instance Method Summary
-
#sanitize(html, options = {})
This
sanitize
helper will HTML encode all tags and strip all attributes that aren't specifically allowed. -
#sanitize_css(style)
Sanitizes a block of CSS code.
-
#strip_links(html)
Strips all link tags from
text
leaving just the link text. -
#strip_tags(html)
Strips all HTML tags from the
html
, including comments.
Instance Method Details
#sanitize(html, options = {})
This sanitize
helper will HTML encode all tags and strip all
attributes that aren't specifically allowed.
It also strips href/src tags with invalid protocols, like javascript: especially. It does its best to counter any tricks that hackers may use, like throwing in unicode/ascii/hex values to get past the javascript: filters. Check out the extensive test suite.
<%= sanitize @article.body %>
You can add or remove tags/attributes if you want to customize it a bit.
See ::ActionView::Base for full docs on the available options. You can add
tags/attributes for single uses of sanitize
by passing either
the :attributes
or :tags
options:
Normal Use
<%= sanitize @article.body %>
Custom Use - Custom Scrubber (supply a Loofah::Scrubber
that does the
sanitization)
scrubber can either wrap a block: scrubber = Loofah::Scrubber.new
do
|node|
node.text = "dawn of cats"
end
or be a subclass of Loofah::Scrubber
which responds to scrub: class
KittyApocalypse < Loofah::Scrubber
def scrub(node)
node.text = "dawn of cats"
end
end scrubber = KittyApocalypse.new
<%= sanitize @article.body, scrubber: scrubber %>
A custom scrubber takes precedence over custom tags and attributes Learn more about scrubbers here: github.com/flavorjones/loofah
Custom Use - tags and attributes (only the mentioned tags and attributes are allowed, nothing else)
<%= sanitize @article.body, tags: %w(table tr td), attributes: %w(id class style) %>
Add table tags to the default allowed tags
class Application < Rails::Application
config.action_view. = ['table', 'tr', 'td']
end
Remove tags to the default allowed tags
class Application < Rails::Application
config.after_initialize do
ActionView::Base..delete 'div'
end
end
Change allowed default attributes
class Application < Rails::Application
config.action_view.sanitized_allowed_attributes = ['id', 'class', 'style']
end
Please note that sanitizing user-provided text does not guarantee that the resulting markup is valid (conforming to a document type) or even well-formed. The output may still contain e.g. unescaped '<', '>', '&' characters and confuse browsers.
82 83 84
# File 'actionview/lib/action_view/helpers/sanitize_helper.rb', line 82
def sanitize(html, = {}) self.class.white_list_sanitizer.sanitize(html, ).try(:html_safe) end
#sanitize_css(style)
Sanitizes a block of CSS code. Used by #sanitize when it comes across a style attribute.
87 88 89
# File 'actionview/lib/action_view/helpers/sanitize_helper.rb', line 87
def sanitize_css(style) self.class.white_list_sanitizer.sanitize_css(style) end
#strip_links(html)
Strips all link tags from text
leaving just the link text.
strip_links('Ruby on Rails')
# => Ruby on Rails
strip_links('Please e-mail me at <a href="mailto:me<EMAIL_ADDRESS># => Please e-mail me at<EMAIL_ADDRESS>strip_links('Blog: Visit.')
# => Blog: Visit.
117 118 119
# File 'actionview/lib/action_view/helpers/sanitize_helper.rb', line 117
def strip_links(html) self.class.link_sanitizer.sanitize(html) end
#strip_tags(html)
Strips all HTML tags from the html
, including comments. This uses
Nokogiri for tokenization (via Loofah) and so its HTML parsing ability is
limited by that of Nokogiri.
("Strip these tags!")
# => Strip these tags!
("Bold no more! See more here...")
# => Bold no more! See more here...
("
Welcome to my website!
")
# => Welcome to my website!
103 104 105
# File 'actionview/lib/action_view/helpers/sanitize_helper.rb', line 103
def (html) self.class.full_sanitizer.sanitize(html) end


My Portfolio
This is my portfolio.
My name is Abas Farah. I'm a computer engineering major at the University of Minnesota.
I've previously worked at Target as a Software Enginering Intern. During my internship I worked on various reactjs and springboot projects.
I also built a calculator using the pic24 microcontroller.
Check out my Linkedin. and my Github as well.
Click here to see content created by server code.
Click here to get a random message:
Click here to get the next Fibonacci Number


|
|
Meridian Point : LV-1
Location: On the lateral side of the the big toe, .1 cun from the corner of the nail.
English Name: Large Pile
Pinyin Name: Da Dun
Actions & Effect:
Jing Well Point - loss of consciousness, moves Qi in the genital area.
Shan Disorder - swollen genitals.
Lin Disorders.
Uterine/Menstrual bleeding from excess or deficiency.
Emotional manifestations of LV Qi Stagnation - inappropriate emotions, depression, lethargy.
Disease
Headache, coma, hernia, epilepsy, contraction of the genitalia, unsmooth urination, irregular menstruation
Meridian Point : LV-2
Location: On the dorsum of the foot between the 1st and 2nd toes, proximal to the margin of the web at the junction of the red and white skin.
English Name: Moving Between
Pinyin Name: Xing Jian
Actions & Effect:
Generally, clears LV Fire - extreme irritability, red face/eyes/tongue.
Clears Heat from the Lower Jiao - burning urination.
Useful for "true heat, false cold" - lack of Qi flow to the extremities (cold hands/feet).
Disease
Headache, vertigo, travel sickness, swelling and pain of the eye, glaucoma, insomnia, painful urination, facial paralysis, hypochondriac pain, bitter taste in the mouth, jaundice, swelling and pain in the dorsum of the foot and numbness of toes
Meridian Point : LV-3
Location: On the dorsum of the foot in a depression distal to the junctions of the 1st and 2nd metatarsal bones.
English Name: Great Surge
Pinyin Name: Tai Chong
Actions & Effect:
Generally, resolves stagnation and tonifies Yin - balancing for all LV pathologies.
LV Qi Stagnation / LV Yang Rising - headaches, dizziness, canker sores.
Eye issues - blurred vision, red, swollen, painful eyes.
Menstrual issues from Deficient Blood, Yin, Qi a/or LV Qi Stagnation - dysmennorrhea, amenorrhea, PMS, breast tenderness.
Genital issues - pain/swelling, hernia, impotence, semianl emission.
Stagnation in the middle warmer - subcostal tension, chest/flank pain, swellings in the axillary region.
Digestive issues from LV attacking ST/SP - nausea, vomiting, constipation, diarrhea w/ undigested food.
Calming point - anger, irritability, insomnia, anxiety.
With LI 4, four gates treatment - powerfully effects the flow of Qi and Blood in the body.
Tong Ren/Tam Healing System: Important point to descend energy in the body, generally used after qi gong exercises, energy healing sessions, etc. Helps to avoid qi gong sickness (or running fire) where energy is stuck in the upper part of the head/body and causes issues such as shortness of breath, psychological issues, headache, etc.
Disease
Headache, vertigo, redness and swelling pain of eyes, glaucoma, nearsightedness, facial paralysis, epilepsy, vomiting, hiccups, stomach ache
Meridian Point : LV-4
Location: Anterior to the medial malleolus, midway between SP 5 and ST 41, in a depression on the medial side of the tendon of tibialis anterior.
English Name: Mound Center
Pinyin Name: Zhong Feng
Actions & Effect:
Generally, moves stagnation and clears heat - Hepatitis, Jaundice
Lin Disorders.
Medial Knee/ankle pain.
Disease
Hernia, dysuria, abdominal pain, jaundice
Meridian Point : LV-5
Location: 5 cun above the tip of the medial malleolus on the midline of the surface of the tibia.
English Name: Woodworm Canal
Pinyin Name: Li Gou
Actions & Effect:
Genital Issues, especially damp-heat related infections/discharges.
Disease
Irregular menstruation, prolapse of the uterus, hernia, lower abdominal pain
Meridian Point : LV-6
Location: 7 cun above the tip of the medial malleolus on the midline of the medial surface of the tibia.
English Name: Central Metropolis
Pinyin Name: Zhong Du
Actions & Effect:
Acute hepatitis.
Pain along the channel, genital region or medial knee.
Disease
Hypochondriac pain, abdominal pain and distension, diarrhea, hernia
Meridian Point : LV-7
Location: 1 cun posterior to SP 9, posterior and inferior to the medial condyle of the tibia in the upp[er portion of the medial head of the gastrocnemius muscle.
English Name: Knee Joint
Pinyin Name: Xi Guan
Actions & Effect:
Local point.
Disease
Swelling and pain of the knee, obstruction syndromes of lower limbs
Meridian Point : LV-8
Location: At the medial end of the transverse popliteal crease, posterior to the medial epicondyle of the tibia, in a depression on the anterior border of the insertions of semimembraneous and semitendoneous, with the knee flexed.
English Name: Spring at the Bend
Pinyin Name: Qu Quan
Actions & Effect:
Tonify LV Yin and Blood, clears excess heat patterns.
Genital issues related to damp-heat - pain/swelling, retention of urine, cystitis, prostatitis, ovarian cysts.
Tonify Yin from mental, physical, emotional strain.
Medial knee pain.
Tong Ren/Tam Healing System: Knee problems, even if on the lateral side of the knee, also useful for abdominal pain, urination issues, groin issues (itch/pain).
Disease
Irregular menstruation, unsmooth urination, swelling and pain in the knee
Meridian Point : LV-9
Location: 4 cun above the medial epicondyle of the femur, between vastus medialis and sartorius.
English Name: Yin Bladder
Pinyin Name: Yin Bao
Actions & Effect:
Local point.
Disease
Lower abdominal pain
Meridian Point : LV-10
Location: 3 cun below ST 30 at the proximal end of the thigh and lateral border of adductor longus (1 cun below LV 11).
English Name: Foot Five Li
Pinyin Name: Zu Wu Li
Actions & Effect:
Local point.
Disease
Lower abdominal pain
Meridian Point : LV-11
Location: 2 cun below ST 30 at the proximal end of the thigh and on the lateral border of adductor longus.
English Name: Yin Corner
Pinyin Name: Yin Lian
Actions & Effect:
Local point.
The LV 9 - LV 11 area may be reactive in women with fertility problems - moxa at LV 11 may be helpful.
Disease
Irregular menstruation
Meridian Point : LV-12
Location: Lateral to the pubic tubercle, lateral and inferior to ST 30, in the inguinal groove where the femoral artery is palpable, 2.5 cun lateral to the anterior midline.
English Name: Urgent Pulse
Pinyin Name: Ji Mai
Actions & Effect:
Local Point.
May be useful for groin pain.
Disease
Hernia, abdominal pain, pain in the external genitalia
Meridian Point : LV-13
Location: On the lateral side of the abdomen below the free end of the 11th rib.
English Name: Camphorwood Gate
Pinyin Name: Zhang Men
Actions & Effect:
Assist with SP Deficient signs esp. from the LV invading the SP - pain and distention of the abdomen, vomiting, constipation, diarrhea (or alternating), bloating, undigested food in the bowels.
Hui Meeting Point of the Zang - tonify all Zang organs.
Running Piglet Disorder.
Disease
Abdominal pain, distension and mass, diarrhea, vomiting, pain in the loins and spine
Meridian Point : LV-14
Location: On the mamillary line, directly below the nipple, 4 cun lateral to the AML in the 6th ICS.
English Name: Cycle Gate
Pinyin Name: Qi Men
Actions & Effect:
Strong effect on the middle and upper warmers - subcostal tension, chest/rib pain, LV overacting on the LU (cough, SOB).
Effects LV organ, Qi/Blood stagnation - hepatitis, gallstones.
Emotional imbalances - anger, irritability.
Running Piglet Disorder.
Disease
Hypochondriac pain, bitter taste in the mouth, vomiting, hiccups
|


The following utilities can be used to add additional styles to texts.
All HTML headings,

through

are available. .h1
through .h6
classes are also available, for when you want to match the font styling of a heading but cannot use the associated HTML element.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
.text-muted
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
.text-primary
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
.text-success
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
.text-info
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
.text-warning
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
.text-danger
Left aligned text on all viewport sizes.
Left aligned text on viewports sized SM (small) or wider.
Left aligned text on viewports sized MD (medium) or wider.
Left aligned text on viewports sized LG (large) or wider.
Left aligned text on viewports sized XL (extra-large) or wider.
.text-*-left
Center aligned text on all viewport sizes.
Center aligned text on viewports sized SM (small) or wider.
Center aligned text on viewports sized MD (medium) or wider.
Center aligned text on viewports sized LG (large) or wider.
Center aligned text on viewports sized XL (extra-large) or wider.
.text-*-center
Right aligned text on all viewport sizes.
Right aligned text on viewports sized SM (small) or wider.
Right aligned text on viewports sized MD (medium) or wider.
Right aligned text on viewports sized LG (large) or wider.
Right aligned text on viewports sized XL (extra-large) or wider.
.text-*-right
.list-unstyled
.list-inline
Align terms and descriptions horizontally by using our grid system’s predefined classes (or semantic mixins). For longer terms, you can optionally add a text-truncate
class to truncate the text with an ellipsis.
Use class align-baseline, align-top, align-middle, align-bottom, align-text-top, align-text-bottom
Bold text.
.font-weight-bold
Normal weight text.
.font-weight-normal
Italicized text.
.font-italic
lowercased text.
.text-lowercase
uppercased text.
.text-uppercase
capitalized text.
.text-capitalize
.rounded
.rounded-circle
.rounded-top
.rounded-right
.rounded-bottom
.rounded-left


--- title: Working with package citations author: Luke McGuinness date: '2021-02-12' slug: working-with-package-citations categories: - R tags: [] excerpt: Put excerpt here math: no meta: yes draft: yes ---


Network Bearer Selection API
Cellular network status:
Updating...
Wireless network status:
Updating...
Cellular
Unknown
Request Route
Release Route


NATIONAL LAMPOON'S SENIOR TRIP A film review by Chad Polenz Copyright 1997 Chad Polenz
z- [0] (out of 4 = beyond terrible) 1995, R, 91 minutes [1 hour, 31 minutes] [comedy] starring: Matt Frewer (Principal Todd Moss), Valerie Mahaffery (Miss Tracy Milford), Tommy Chong (Red), Jeremy Renner (Dags), written by Roger Kumble, I. Marlene King, produced by Wendy Grean, directed by Kelly Makin.
It's really sad that movies as bad as "National Lampoon's Senior Trip" are made, let alone thought up. I can't image what went on during the pitch for this movie, maybe the executives were temporarialy insane to approve something this ludicrous. Everything in Hollywood is ripped off of something else, but how low does National Lampoon have to be to rip off itself?
There really isn't a plot here, only a simple and extremely predictable story about a group of cliche, idiotic, high school slackers who crash the principal's house for a party, and then proceed to drive from Ohio to Washington to meet the president to tell him the education system "sucks." But this movie doesn't even try to be anything original. It is the epitome of bad, raunchy, semi-pornographic B-movies that are shown on cable at 3 a.m., but in this case it's with high school students and that only makes it more sick.
The road trip and the brat pack of teens is a staple for Hollywood comedy, but this film goes beyond the realms of good taste and offers shock value comedy, while at the same time delivering childish, cartoony humor and antics. Of course all the students hate their anal, geeky, dumbfound principal, Mr. Moss (Frewer).
 But it's not enough to just have these characters present, the film goes as far as to essentially label them with arrows by the sheer appearance of the characters alone. There is absolutely no subtlety here.
I don't know what went through the writers' heads while scripting this. Are we really supposed to think only sex, drugs, and alcohol are funny? Are we supposed to be curious about these characters and wonder how they will interact with each other? Are we supposed to think teenagers interacting with debutantes and getting them drunk and having a massive orgy is funny? I appreciate a lowbrow joke now and then, but this is so low it's enough to make you sick. It could be considered obscene, not because of its substance, but because of its attitude - that it actually presents itself as something to take seriously.
I shouldn't even begin to nitpick at all the fallacies to "National Lampoon's Senior Trip," let's just say whatever could be bad about it is. In fact "bad" isn't even a strong enough word, only "terrible" or even "vile" would really be accurate.
please visit Chad'z Movie Page @ http://members.aol.com/ChadPolenz
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Tatami are rectangular mats, used to completely cover the floor of a room, without overlap.
Assuming that the only type of available tatami has dimensions 12, there are obviously some limitations for the shape and size of the rooms that can be covered.
For this problem, we consider only rectangular rooms with integer dimensions a, b and even size s = a·b.
We use the term 'size' to denote the floor surface area of the room, and — without loss of generality — we add the condition a b.
There is one rule to follow when laying out tatami: there must be no points where corners of four different mats meet.
For example, consider the two arrangements below for a 44 room:
The arrangement on the left is acceptable, whereas the one on the right is not: a red "X" in the middle, marks the point where four tatami meet.
Because of this rule, certain even-sized rooms cannot be covered with tatami: we call them tatami-free rooms.
Further, we define T(s) as the number of tatami-free rooms of size s.
The smallest tatami-free room has size s = 70 and dimensions 710.
All the other rooms of size s = 70 can be covered with tatami; they are: 170, 235 and 514.
Hence, T(70) = 1.
Similarly, we can verify that T(1320) = 5 because there are exactly 5 tatami-free rooms of size s = 1320:
2066, 2260, 2455, 3044 and 3340.
In fact, s = 1320 is the smallest room-size s for which T(s) = 5.
Find the smallest room-size s for which T(s) = 200.


{{ site.data.company.mission_statement }}
{{ site.data.company.email }}
{{ site.data.company.phone }}
Website and brotherly love provided by alasda.ir