std::abs<div class="t-tr-text">ï¼ã¹ã¿ã³ãã¼ã:: valarrayã¯ï¼<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">(std::valarray)</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>
æä¾: cppreference.com
![]() |
ãã®ãã¼ã¸ã¯ãGoogle 翻訳ã使ã£ã¦è±èªçããæ©æ¢°ç¿»è¨³ããã¾ããã
翻訳ã«ã¯èª¤ããå¥å¦ãªè¨ãåããããããããã¾ãããæç« ã®ä¸ã«ãã¤ã³ã¿ãããã¨ãå ã®æç« ãè¦ãã¾ãã誤ããä¿®æ£ãã¦ç¿»è¨³ãæ¹åããæå©ãããã¦ãã ããã翻訳ã«ã¤ãã¦ã®èª¬æã¯ããããã¯ãªãã¯ãã¦ãã ããã ãã®ãã¼ã¸ã®è±èªçãè¦ãã«ã¯ãããã¯ãªãã¯ãã¦ãã ãã |
Defined in header <valarray>
|
||
template< class T > valarray<T> abs( const valarray<T>& va ); |
||
å¤ã®é
åã®åè¦ç´ ã®çµ¶å¯¾å¤ãè¨ç®ãã.
Original:
Computes absolute value of each element in the value array.
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.
ç®æ¬¡ |
[ç·¨é] ãã©ã¡ã¼ã¿
va | - | ã«æä½ãé©ç¨ããå¤ã®é
å
Original: value array to apply the operation to The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[ç·¨é] å¤ãè¿ãã¾ã
va
å
ã®å¤ã®çµ¶å¯¾å¤ãå«ãå¤ã®é
å.Original:
Value array containing absolute values of the values in
va
.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.
[ç·¨é] ãã¼ã
修飾ããã¦ããªãæ©è½ï¼absï¼è¨ç®ãå®è¡ããããã«ä½¿ç¨ããã¾ãããã®ãããªæ©è½ãå©ç¨ã§ããªãå ´åãstd::absã¯ã弿°ä¾åã®ç
§åã®ããã«ä½¿ç¨ãã.
Original:
Unqualified function (abs) is used to perform the computation. If such function is not available, std::abs is used due to argument dependent lookup.
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.
颿°ã¯std::valarrayããå¥ã®æ»ãå¤åã§å®è£
ãããã¨ãã§ãã¾ãããã®å ´åã交æåã¯ã次ã®ããããã£ãããã¾ã
Original:
The function can be implemented with the return type different from std::valarray. In this case, the replacement type has the following properties:
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.
- constã®ãã¹ã¦std::valarrayã¡ã³ã颿°ãç¨æããã¦ãã¾ã.Original:All const member functions of std::valarray are provided.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - std::valarrayãstd::slice_arrayãstd::gslice_arrayãstd::mask_arrayã¨std::indirect_array交æã¿ã¤ãããæ§ç¯ãããã¨ãã§ãã¾ã.Original:std::valarray, std::slice_array, std::gslice_array, std::mask_array and std::indirect_array can be constructed from the replacement type.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - ã¿ã¤ãconst std::valarray&ã®å¼æ°ãåãä»ããæ©è½ã¯ããã¹ã¦ã®äº¤æã¿ã¤ããåãå ¥ããå¿ è¦ãããã¾ã.Original:All functions accepting a arguments of type const std::valarray& should also accept the replacement type.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - ã¿ã¤ãconst std::valarray&ã®2ã¤ã®å¼æ°ãåãå ¥ãããã¹ã¦ã®æ©è½ãconst std::valarray&ã¨äº¤æã¿ã¤ãã®ãã¹ã¦ã®çµã¿åãããåãå ¥ããã¹ã.Original:All functions accepting two arguments of type const std::valarray& should accept every combination of const std::valarray& and the replacement type.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
-
[ç·¨é] å¯è½ãªå®è£
template< class T > valarray<T> abs( const valarray<T>& va ) { valarray<T> other = va; for (T &i : other) { i = abs(i); } return other; // proxy object may be returned } |
[ç·¨é] ä¾
ãã®ã³ã¼ããå®è¡ãã¾ã
#include <valarray> #include <iostream> int main() { std::valarray<int> v{1, -2, 3, -4, 5, -6, 7, -8}; std::valarray<int> v2 = std::abs(v); for(auto n : v2) { std::cout << n << ' '; } std::cout << '\n'; }
åºå:
1 2 3 4 5 6 7 8
[ç·¨é] åç §
æ´æ°å¤ï¼|x|ï¼ã®çµ¶å¯¾å¤ãè¨ç®ãã¾ã Original: computes absolute value of an integral value (|x|) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (颿°) | |
æµ®åå°æ°ç¹å¤ã®çµ¶å¯¾å¤ï¼|x|ï¼ Original: absolute value of a floating point value (|x|) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (颿°) | |
è¤ç´ æ°ã®çµ¶å¯¾å¤ãè¿ãã¾ã Original: returns the magnitude of a complex number The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (颿°ãã³ãã¬ã¼ã) |