std::valarray::sum
提供: cppreference.com
![]() | このページは、Google 翻訳を使って英語版から機械翻訳されました。 翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
T sum()const; | ||
要素の和を計算.
Original:
Computes the sum of the elements.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
関数はoperator+=がタイプ
T
定義されている場合にのみ使用することができます。 std::valarray
が空の場合、動作は未定義です。要素は、この関数によって処理される順序は不定である.Original:
The function can be used only if operator+= is defined for type
T
. If the std::valarray
is empty, the behavior is undefined. The order in which the elements are processed by this function is unspecified.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集]パラメータ
(なし)
[編集]値を返します
要素の和.
Original:
The sum of the elements.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集]例
このコードを実行します
#include <iostream>#include <valarray> int main(){std::valarray<int> a ={1, 2, 3, 4, 5, 6, 7, 8, 9, 10};std::cout<< a.sum()<<'\n';}
出力:
55
[編集]参照
applies a function to every element of a valarray (パブリックメンバ関数) | |
要素の範囲をまとめている Original: sums up a range of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) |