valarray基本了解

Xredman posted @ Jun 19, 2009 09:59:30 AM in 以前博文 , 1118 阅读

 

valarray类似于向量vector,其主要用途是对一系列元素进行进行高速的数学计算
#include <iostream>
#include <valarray>
using namespace std;

int main()
{
        int i, n = 10;
        valarray<int> va1(n), va2(n);
       
        for(i = 0; i < n; i++)
        {
                va1[i] = i;
                va2[i] = -i;
        }
        
        cout<<"MAX: "<<va1.max()<<" MIN:"<<va1.min()<<endl;
        va2 += va1;
        for(i = 0; i < n; i++)
                cout<<va2[i]<<" ";
       
        return 0;
}

 

 






  • 无匹配
  • 无匹配
AP SSC fa 4 Question 说:
Sep 08, 2022 07:15:28 AM

Formative Assessment means not only an examination, it includes various aspects such as Examination in completed lessons, Reflections, Project work done on the allotted topic and Self also Prepared notes etc. AP SSC fa 4 Question Paper Candidates of Telugu Medium, English Medium & Urdu Medium of the AP State can download the AP 10th Class FA 4 Model Paper 2023 Pdf with answers for the regular exams conducted by the Directorate of Government Examinations, Andhra Pradesh.

baños cerca de mi 说:
Jul 28, 2023 04:27:33 AM

Cuando viajamos, necesitamos encontrar baños, baños o baños públicos en la ubicación actual. El uso de Google Maps, Google Assistant, Alexa, iPhone Siri y otros servicios de búsqueda de ubicación lo ayudan a obtener fácilmente los baños y baños públicos más cercanos. baños cerca de mi Aquí hemos discutido varios servicios de búsqueda de ubicación que lo ayudan a encontrar los baños públicos más cercanos a su ubicación actual donde se encuentra.

West Bengal 9th Cla 说:
Aug 22, 2023 08:48:25 PM

West Bengal Education Board Committee will Desin and Every Year Latest Study Materiel Upload West Bengal Model Paper 2024 as Pdf Format Every year on the official website, Students need to Prepare for the Final Exam by Taking these West Bengal Question Paper 2024 as a Reference for Getting a good Percentage in the Examination 2024,West Bengal Question Paper 2024 Download here the Students West Bengal 9th Class Book 2024 of are Very Important for the Preparation of Final Examination 2024 Prepare yourself accordingly, Student Needs to Practice Various Types of Suggestions, will get a Better idea and Understanding About the totality of Examination 2024.

pavzi.com 说:
Jan 08, 2024 06:25:46 AM

Pavzi website is a multiple Niche or category website which will ensure to provide information and resources on each and every topic. Some of the evergreen topics you will see on our website are Career, Job Recruitment, Educational, Technology, Reviews and others. pavzi.com We are targeting mostly so it is true that Tech, Finance, and Product Reviews. The only reason we have started this website is to make this site the need for your daily search use.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter