Giter VIP home page Giter VIP logo

utilpack's Introduction

MIT License

utilpack

使いまわせそうなプログラムの保存用レポジトリ。C++14用。(clang,gccではC++11でも使用可能。)

array_matrix.hpp

namespace Utilpack {
template <typename valu_T, std::size_t row_Num, std::size_t column_Num>
class array_matrix;
}

2次元のarray。 以下の関数とstd::arrayの関数を複数実装。

メンバ関数 補足
at(std::size_t, std::size_t) (行番号,列番号)の要素にアクセス。
rowbegin(std::size_t) 行の先頭要素を指すイテレータを取得する。
rowend(std::size_t) 行の末尾の1つ次の要素を指すイテレータを取得する。
columnbegin(std::size_t) 列の先頭要素を指すstride_iteratorを取得する。
columnend(std::size_t) 行の末尾の1つ次の要素を指すstride_iteratorを取得する。
size() 要素数を取得する。
max_size() 格納可能な最大の要素数を取得する。
row_num() 行数を取得する。
column_num() 列数を取得する。
empty()              コンテナが空かどうかを判定する。

at()はコンパイルオプションに-D DEBUGを指定した場合、範囲外参照チェックを行う。

演算子 補足
==
!=
<< " "刻みで要素を矩形に出力。

stride_iterator.hpp

一度に指定幅進むイテレーター。

utilpack's People

Contributors

yutakasi634 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.