This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
void printTypeSize() { | |
std::cout << "Size of char = " << sizeof(char) << " byte" << std:: endl; | |
std::cout << "Size of short = " << sizeof(short) << " byte" << std:: endl; | |
std::cout << "Size of int = " << sizeof(int) << " byte" << std:: endl; | |
std::cout << "Size of long = " << sizeof(long) << " byte" << std:: endl; | |
} | |
struct S1 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation | |
on: #(1) | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
page_build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
import io | |
import sys | |
TAGfile = open(sys.argv[1]+"/Testing/TAG", 'r') #(1) | |
dirname = TAGfile.readline().strip() | |
xslfile = open(sys.argv[2], 'r') | |
xslcontent = xslfile.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stable-slim #(1) | |
LABEL maintainer="[email protected]" \ | |
description="Image which consists of C++ related build tools." \ | |
version="1.0" | |
RUN apt-get update -y && \ | |
apt-get install -y --no-install-recommends \ #(2) | |
git \ | |
openssh-server \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2.1 | |
executors: #(1) | |
exectr: | |
docker: | |
- image: dockerben/cpptemplate:latest #(2) | |
jobs: | |
build: | |
executor: exectr #(1) | |
steps: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CholeskyDecomposition { | |
template<typename T> | |
Matrix<T> SimplifySymmetricMatrix(Matrix<T> matrix) { | |
const size_t nbRows = matrix.rows(); | |
const size_t nbColumns = matrix.columns(); | |
for(size_t row = 0; row < nbRows; ++row) { | |
for(size_t column = row + 1; column < nbColumns; ++column) { | |
matrix(row, column) = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace PivotLUDecomposition { | |
template<typename T> | |
struct Decomposition { | |
Matrix<T> P; | |
Matrix<T> L; | |
Matrix<T> U; | |
Decomposition(const Matrix<T> &matrix) : P(matrix.rows(), matrix.columns()), L(matrix.rows(), matrix.columns()), U(matrix) {} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
Decomposition<T> Decompose(const Matrix<T> &matrix) { | |
const size_t nbRows = matrix.rows(); | |
const size_t nbColumns = matrix.columns(); | |
if(nbRows != nbColumns) { | |
throw std::domain_error("Matrix is not square."); | |
} | |
Decomposition<T> decomposition(matrix); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
class Matrix { | |
static_assert(std::is_arithmetic<T>::value, "T must be numeric"); | |
public: | |
~Matrix() = default; | |
Matrix(size_t rows, size_t columns, T *m) | |
: nbRows(rows), nbColumns(columns), matrix(std::make_unique<T[]>(rows*columns)) | |
{ | |
const size_t size = nbRows*nbColumns; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct __array_traits | |
{ | |
typedef _Tp _Type[_Nm]; //(1) | |
typedef __is_swappable<_Tp> _Is_swappable; | |
typedef __is_nothrow_swappable<_Tp> _Is_nothrow_swappable; | |
static constexpr _Tp& | |
_S_ref(const _Type& __t, std::size_t __n) noexcept | |
{ return const_cast<_Tp&>(__t[__n]); } |
NewerOlder