std::valarray
Da cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Definido no cabeçalho <valarray>
|
||
template< class T > class valarray; |
||
std::valarray é a classe para representar e manipular matrizes de valores. Ele suporta elemento sábios operações matemáticas e várias formas de operadores generalizadas subscrito, corte e acesso indirecto.
Original:
std::valarray is the class for representing and manipulating arrays of values. It supports element-wise mathematical operations and various forms of generalized subscript operators, slicing and indirect access.
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.
[editar] Notas
Classes std::valarray e auxiliar são definidas para ser livre de certas formas de aliasing, permitindo assim que as operações dessas classes de ser optimizado semelhante ao efeito da palavra-chave
restrict
na linguagem de programação C. Além disso, funções e operadores que levam argumentos valarray
têm permissão para retornar objetos proxy para torná-lo possível para o compilador para otimizar uma expressão como v1 = a*v2 + v3; como um único laço que executa v1[i] = a*v2[i] + v3[i]; evitando temporários ou passes múltiplos. No entanto, modelos de expressão fazer a mesma técnica de optimização disponível para qualquer C + + recipiente, e a maioria das bibliotecas de expressão de modelos numéricos preferem a valarrays de flexibilidade. Algumas implementações de C + + biblioteca padrão usar modelos de expressão para implementar operações eficientes em std::valarray
(por exemplo, GNU libstdc + + e libc LLVM + +), e só raramente são otimizados valarrays mais longe, por exemplo, em Intel Parallel Studio.Original:
std::valarray and helper classes are defined to be free of certain forms of aliasing, thus allowing operations on these classes to be optimized similar to the effect of the keyword
restrict
in the C programming language. In addition, functions and operators that take valarray
arguments are allowed to return proxy objects to make it possible for the compiler to optimize an expression such as v1 = a*v2 + v3; as a single loop that executes v1[i] = a*v2[i] + v3[i]; avoiding any temporaries or multiple passes. However, modelos de expressão make the same optimization technique available for any C++ container, and the majority of numeric libraries prefer expression templates to valarrays for flexibility. Some C++ standard library implementations use expression templates to implement efficient operations on std::valarray
(e.g. GNU libstdc++ and LLVM libc++), and only rarely valarrays are optimized any further, e.g. in Intel Parallel Studio.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.
[editar] Tipos de membro
Tipo de membro
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
value_type
|
T
|
[editar] Funções de membro
constrói nova matriz numérica Original: constructs new numeric array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
destrói a matriz numérica Original: destructs the numeric array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
atribui o conteúdo Original: assigns the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
get / set elemento valarray, uma fatia ou máscara Original: get/set valarray element, slice, or mask The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
aplica-se um operador unário aritmética para cada elemento da valarray Original: applies a unary arithmetic operator to each element of the valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
aplica-se operador de atribuição composto para cada elemento da valarray Original: applies compound assignment operator to each element of the valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
swaps com outro valarray Original: swaps with another valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
retorna o tamanho de valarray Original: returns the size of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
altera o tamanho do valarray Original: changes the size of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
calcula a soma de todos os elementos Original: calculates the sum of all elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
retorna o elemento mais pequeno Original: returns the smallest element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
retorna o elemento maior Original: returns the largest element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
zero-enchimento deslocar os elementos do valarray Original: zero-filling shift the elements of the valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
deslocamento circular dos elementos do valarray Original: circular shift of the elements of the valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
applies a function to every element of a valarray (função pública membro) |
[editar] Não-membros funções
(C++11) |
o algoritmo especializado std::swap() Original: specializes the std::swap() algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
(C++11) |
std::begin especializada Original: specializes std::begin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
(C++11) |
std::end especializada Original: specializes std::end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
aplica-se operadores binários para cada elemento de duas valarrays, ou um valarray e um valor Original: applies binary operators to each element of two valarrays, or a valarray and a value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
compara dois valarrays ou um valarray com um valor Original: compares two valarrays or a valarray with a value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::abs função de cada elemento de valarray Original: applies the function std::abs to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
Original: Exponential functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
aplica-se a std::exp função de cada elemento de valarray Original: applies the function std::exp to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::log função de cada elemento de valarray Original: applies the function std::log to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::log10 função de cada elemento de valarray Original: applies the function std::log10 to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
Original: Power functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
aplica-se a função de dois std::pow valarrays ou um valarray e um valor Original: applies the function std::pow to two valarrays or a valarray and a value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::sqrt função de cada elemento de valarray Original: applies the function std::sqrt to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
Original: Trigonometric functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
aplica-se a std::sin função de cada elemento de valarray Original: applies the function std::sin to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::cos função de cada elemento de valarray Original: applies the function std::cos to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::tan função de cada elemento de valarray Original: applies the function std::tan to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::asin função de cada elemento de valarray Original: applies the function std::asin to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::acos função de cada elemento de valarray Original: applies the function std::acos to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::atan função de cada elemento de valarray Original: applies the function std::atan to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a função de um std::atan2 valarray e um valor Original: applies the function std::atan2 to a valarray and a value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
Original: Hyperbolic functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
aplica-se a std::sinh função de cada elemento de valarray Original: applies the function std::sinh to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::cosh função de cada elemento de valarray Original: applies the function std::cosh to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
aplica-se a std::tanh função de cada elemento de valarray Original: applies the function std::tanh to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
[editar] Classes auxiliares
BLAS-como fatia de um valarray: índice inicial, comprimento da passada Original: BLAS-like slice of a valarray: starting index, length, stride The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
proxy para um subconjunto de uma valarray após a aplicação de uma fatia Original: proxy to a subset of a valarray after applying a slice The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
fatia generalizada de uma valarray: índice inicial, conjunto de comprimentos, conjunto de passos Original: generalized slice of a valarray: starting index, set of lengths, set of strides The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
proxy para um subconjunto de uma valarray após a aplicação de uma GSlice Original: proxy to a subset of a valarray after applying a gslice The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
proxy para um subconjunto de uma valarray após a aplicação de um operador booleano máscara [] Original: proxy to a subset of a valarray after applying a boolean mask operator[] The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
proxy para um subconjunto de um valarray após a aplicação indireta operador [] Original: proxy to a subset of a valarray after applying indirect operator[] The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |