Skip to content

Instantly share code, notes, and snippets.

View komasaru's full-sized avatar

mk-mode komasaru

View GitHub Profile
@komasaru
komasaru / is_integer.cpp
Last active August 26, 2020 01:43
C++ source code to judge if a string is an integer.
/***************************************************************
Check integer
$ g++ -std=c++17 -Wall -O2 --pedantic-errors -o is_integer is_integer.cpp
DATE AUTHOR VERSION
2020.08.21 mk-mode.com 1.00 新規作成
Copyright(C) 2020 mk-mode.com All Rights Reserved.
***************************************************************/
@komasaru
komasaru / factorial.cpp
Created August 18, 2020 01:01
C++ source code to calculate factorials with GMP.
/***************************************************************
Factorial of N
by GMP(The GNU Multi Presicion Arithmetic Library).
$ g++ -std=c++17 -Wall -O2 --pedantic-errors -lgmp -lgmpxx -o factorial factorial.cpp
DATE AUTHOR VERSION
2020.08.17 mk-mode.com 1.00 新規作成
Copyright(C) 2020 mk-mode.com All Rights Reserved.
@komasaru
komasaru / calc.cpp
Last active November 10, 2022 11:22
C++ source code to interpolate by 3D-Spline.
#include "calc.hpp"
#include <cmath>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
/**
* @brief 配列サイズ取得
@komasaru
komasaru / file.cpp
Created July 29, 2020 02:32
C++ source code to do LU-decomposition by Crout method.
#include "file.hpp"
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
bool File::get_text(std::vector<std::vector<double>>& data) {
try {
// ファイル OPEN
@komasaru
komasaru / file.cpp
Created July 29, 2020 02:21
C++ source code to do LU-decomposition by inner-product form.
#include "file.hpp"
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
bool File::get_text(std::vector<std::vector<double>>& data) {
try {
// ファイル OPEN
@komasaru
komasaru / file.cpp
Last active July 31, 2020 01:12
C++ source code to do LU-decomposition by outer-product form.
#include "file.hpp"
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
bool File::get_text(std::vector<std::vector<double>>& data) {
try {
// ファイル OPEN
@komasaru
komasaru / adjusted_coefficient_of_determination.cpp
Last active July 31, 2020 01:35
C++ source code to calculate an adjusted coefficent of determination for multiple regression.
/***********************************************************
重回帰分析(説明変数2個)決定係数計算
DATE AUTHOR VERSION
2020.07.20 mk-mode.com 1.00 新規作成
Copyright(C) 2020 mk-mode.com All Rights Reserved.
***********************************************************/
#include "calc.hpp"
#include "file.hpp"
@komasaru
komasaru / calc.cpp
Last active October 8, 2021 11:50
C++ source code to compute multiple regression equations.(2d)
#include "calc.hpp"
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
/**
* @brief 重回帰式(説明変数2個; 2次多項式モデル)の計算
*
@komasaru
komasaru / calc.cpp
Last active July 31, 2020 01:30
C++ source code to compute multiple regression equations.(3 explanatory variables)
#include "calc.hpp"
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
/**
* @brief 重回帰式(説明変数3個)の計算
*
@komasaru
komasaru / calc.cpp
Last active July 31, 2020 01:28
C++ source code to compute multiple regression equations.
#include "calc.hpp"
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
/**
* @brief 重回帰式(説明変数2個)の計算
*