C++常用速查
int main()
{
int arr[2][5] =
{
{1,8,12,20,25},
{5,9,13,24,26}
};
}
void f(double p[][10]) {
}
#include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(3,3);
m << 1,2,3,
4,5,6,
7,8,9;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "2nd Row: " << m.row(1) << endl;
m.col(2) += 3 * m.col(0);
cout << "After adding 3 times the first column into the third column, the matrix m is:\n";
cout << m << endl;
Matrix3f m;
m << 1, 2, 3,
4, 5, 6,
7, 8, 9;
std::cout << m;
MatrxXd M = MatrixXd::Zero(50,50);
//矩阵转数组
double* test = M.data();
//数组转矩阵
Map<MatrixXd>tM(test, 50, 50);
MatrixXd M = MatrixXd::Zero(5, 5);
ofstream fout("test.txt");
fout << M;
fout.close();
#include<iostream>
int main()
{
int a[4] = {0,1,2,3};
int b[4];
std::copy(a, a+4, b);
b[3] = 5;
std::cout << "a3 =" << a[3] << std::endl << "b3 =" << b[3] << std::endl;
int c[4] = {0,1,2,3};
int *d = c;
d[3] = 5;
std::cout << "c3 =" << c[3] << std::endl << "d3 =" << d[3] << std::endl;
return 0;
}
double x[] = { .0, .1, .2, .3, .4 };
// Iterate through all elements
for (auto d : x)
{
std::cout << d << std::endl;
}
int main()
{
int sz = 5;
sz = sz + 1;
int a[5] = {1, 2, 3, 4, 5};
int *b = new int[sz];
for(int i=0; i<sz; i++)
{
b[i] = i;
std::cout << b[i] << std::endl;
}
return 0;
}
C++常用速查的更多相关文章
- jQuery 常用速查
jQuery 速查 基础 $("css 选择器") 选择元素,创建jquery对象 $("html字符串") 创建jquery对象 $(callback) $( ...
- postgresql 常用速查
中文资料 中文资料 /**gp中的基本sql语法**/ --删除表 drop table testtb; --创建表 CREATE TABLE testtb ( id integer, "n ...
- 《zw版·Halcon-delphi系列原创教程》 zw版-Halcon常用函数Top100中文速查手册
<zw版·Halcon-delphi系列原创教程> zw版-Halcon常用函数Top100中文速查手册 Halcon函数库非常庞大,v11版有1900多个算子(函数). 这个Top版,对 ...
- 转收藏:Git常用命令速查表
一. Git 常用命令速查 git branch 查看本地所有分支git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支git branch -r ...
- Linux常用命令速查备忘
Linux常用命令速查备忘 PS:备忘而已,详细的命令参数说明自己man 一. 启动,关机,登入,登出相关命令 [login] 登录 [logout] 登出 [exit] 登出 [shutdown ...
- python 下的数据结构与算法---2:大O符号与常用算法和数据结构的复杂度速查表
目录: 一:大O记法 二:各函数高阶比较 三:常用算法和数据结构的复杂度速查表 四:常见的logn是怎么来的 一:大O记法 算法复杂度记法有很多种,其中最常用的就是Big O notation(大O记 ...
- web 开发:CSS3 常用属性——速查手册!
web 开发:CSS3 常用属性——速查手册! CSS3 简介:http://www.runoob.com/css3/css3-intro.html 1.目录 http://caniuse.com/ ...
- Git 常用命令速查表(图文+表格)
一. Git 常用命令速查 git branch 查看本地所有分支git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支git branch -r ...
- Linux常用命令速查-汇总篇
Linux常用命令速查-用户管理 Linux常用命令速查-文件管理 Linux常用命令速查-系统监控 Linux常用命令速查-网络管理 Linux常用命令速查-定时任务 Linux常用命令速查-Vim
随机推荐
- mysql 各数据类型的大小及长度
数字型 类型 大小 范围(有符号) 范围(无符号) 用途 TINYINT 1 字节 (-128,127) (0,255) 小整数值 SMALLINT 2 字节 (-32 768,32 767) (0, ...
- 【HR系列】SAP HR PA信息类型的创建与增强
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HR系列]SAP HR PA信息类型的创建与增 ...
- javase程序设计上机作业1
package javaxgp.teacher.test; import java.math.BigInteger; import java.util.Scanner; import java.uti ...
- Docker 容器操作
1. 创建并运行 一个容器 docker run -it --rm centos:latest bash run 运行容器 -it 以交互方式运行容器 --rm 退出容器后删除容器 cen ...
- 【PyTorch】PyTorch使用LMDB数据库加速文件读取
PyTorch使用LMDB数据库加速文件读取 原始文档:https://www.yuque.com/lart/ugkv9f/hbnym1 对于数据库的了解较少,文章中大部分的介绍主要来自于各种博客和L ...
- css实现毛玻璃效果
css实现毛玻璃效果,效果图 1,html代码 <div class="mainHolder"> <div class="textHolder" ...
- 【转】mysql索引的探究
转自:https://mp.weixin.qq.com/s/XTu7jERv3A0CIAzlECFnlA 相信很多人对于MySQL的索引都不陌生,索引(Index)是帮助MySQL高效获取数据的数据结 ...
- Microsoft BarCode Control 16.0属性
Labview(2018)可通过Active调用Microsoft BarCode Control 16.0来生成条形码, 参考资料如下: 生成效果: 二维码: 条形码: 执行程序发现修改线条宽度不影 ...
- python-day15(正式学习)
目录 递归 函数自我嵌套 调用 直接调用 间接调用 为什么要用递归呢 如何使用递归 内置函数 掌握 了解 面向对象方法 面向过程编程 注册 分层实现功能 递归 递归的本质就是函数调用自身,当然也会有一 ...
- scrapy之360图片爬取
#今日目标 **scrapy之360图片爬取** 今天要爬取的是360美女图片,首先分析页面得知网页是动态加载,故需要先找到网页链接规律, 然后调用ImagesPipeline类实现图片爬取 *代码实 ...