编程语言

讨论主题增加讨论主题

今日函数

matlab mxsetjc

mxSetJc (C and Fortran)

JC array of sparse array

C Syntax

#include "matrix.h"
void mxSetJc(mxArray *pm, mwIndex *jc);

Fortran Syntax

subroutine mxSetJc(pm, jc)
mwPointer pm, jc

Arguments

pm

Pointer to a sparse mxArray

jc

Pointer to the jc array

Description

Use mxSetJc to specify a new jc array for a sparse mxArray. The jc array is an integer array having n+1 elements, where n is the number of columns in the sparse mxArray.

If the jth column of the sparse mxArray has any nonzero elements:

  • jc[j] is the index in ir, pr, and pi (if it exists) of the first nonzero element in the jth column.

  • jc[j+1]-1 is the index of the last nonzero element in the jth column.

  • For the jth column of the sparse matrix, jc[j] is the total number of nonzero elements in all preceding columns.

The number of nonzero elements in the jth column of the sparse mxArray is:

jc[j+1] - jc[j];

For the jth column of the sparse mxArray, jc[j] is the total number of nonzero elements in all preceding columns. The last element of the jc array, jc[number of columns], is equal to nnz, which is the number of nonzero elements in the entire sparse mxArray.

For example, consider a 7-by-3 sparse mxArray named Sparrow containing six nonzero elements, created by typing:

Sparrow = zeros(7,3);
Sparrow(2,1) = 1;
Sparrow(5,1) = 1;
Sparrow(3,2) = 1;
Sparrow(2,3) = 2;
Sparrow(5,3) = 1;
Sparrow(6,3) = 1;
Sparrow = sparse(Sparrow);

The following table lists the contents of the ir, jc, and pr arrays.

Subscript

ir

pr

jc

Comment

(2,1)

1

1

0

Column 1 contains two nonzero elements, with rows designated by ir[0] and ir[1]

(5,1)

4

1

2

Column 2 contains one nonzero element, with row designated by ir[2]

(3,2)

2

1

3

Column 3 contains three nonzero elements, with rows designated by ir[3],ir[4], and ir[5]

(2,3)

1

2

6

There are six nonzero elements in all.

(5,3)

4

1

  

(6,3)

5

1

  

As an example of a much sparser mxArray, consider a 1000-by-8 sparse mxArray named Spacious containing only three nonzero elements. The ir, pr, and jc arrays contain the values listed in this table.

Subscript

ir

pr

jc

Comment

(73,2)

72

1

0

Column 1 contains no nonzero elements.

(50,3)

49

1

0

Column 2 contains one nonzero element, with row designated by ir[0].

(64,5)

63

1

1

Column 3 contains one nonzero element, with row designated by ir[1].

   

2

Column 4 contains no nonzero elements.

   

2

Column 5 contains one nonzero element, with row designated by ir[2].

   

3

Column 6 contains no nonzero elements.

   

3

Column 7 contains no nonzero elements.

   

3

Column 8 contains no nonzero elements.

   

3

There are three nonzero elements in all.

This function does not free any memory allocated for existing data that it displaces. To free existing memory, call mxFree on the pointer returned by mxGetJc before you call mxSetJc.

Examples

See the following examples in matlabroot/extern/examples/mx.

See the following examples in matlabroot/extern/examples/mex.

See Also

mxCreateSparse, mxGetIr, mxGetJc, mxSetIr, mxFree

最新发布文章

  1. 排序
  2. python解无忧公主数学题107.py
  3. ubuntu查看有多少插槽,多少内存.每条内存多大.
  4. 在二维数组中, 根据指定的字段排序
  5. 设置,查看Linux物理内存和交换内存
  6. 关于mc mod制作的一些资源
  7. 算法演示站,一个非常好的算法可视化站点
  8. 'AnyObject' is not convertible to 'UIImage'; did you mean to use 'as!' to force downcast?
  9. Value of optional type 'UIImage?' not unwrapped; did you mean to use '!' or '?'?
  10. swift导入旧项目出错: 'NSString' is not implicitly convertible to 'String'
  11. gif转jpg. 获取gif的第一帧图片做封面
  12. curl 使用范例
  13. linux下wget和curl的区别和语法
  14. shell控制台使用ftp
  15. nsq后台无数据问题的解决, nsqadmin : No producers exist for this topic
  16. js中长文本的缩进和格式化问题
  17. Effective Go 中文版
  18. sed语法 sed用法简介
  19. 开头或末尾批量加字符串
  20. ubuntu下安装nginx错误error: the HTTP rewrite module requires the PCRE library 解决方法

书籍

  1. JavaScript权威指南(第6版)中文版 pdf 文字版(JavaScript:The.Definitive.Guide)David.Flanagan
  2. matlab基础教程--matlab快速入门
  3. matlab数值分析程序--高等数学,数值代数的matlab实现
  4. go web编程--go语言基础教程,go语言做网站

最新章节

  1. 10.8.3 求解常微分方程(组)边值问题数值解的MATLAB库函数
  2. 10.8.2 有限差分方法及其MATLAB程序
  3. 10.8.1 打靶法及其MATLAB程序
  4. 10.8 边值问题的数值解及其MATLAB程序
  5. 10.7.2 高阶微分方程(组)的数值解及其MATLAB程序
  6. 10.7.1 一阶微分方程组的数值解及其MATLAB程序
  7. 10.7 一阶(高)阶微分方程(组)的数值解及其MATLAB程序
  8. 10.6.6 预测-校正系统及其MATLAB程序
  9. 10.6.5 汉明公式及其MATLAB程序
  10. 10.6.4 米尔恩公式及其MATLAB程序
  11. 10.6.3 亚当斯隐式公式及其MATLAB程序
  12. 10.6.2 亚当斯(Adams)显式公式及其MATLAB程序
  13. 10.6 线性多步法及其MATLAB程序
  14. 10.5.5 自适应龙格-库塔方法及其MATLAB程序
  15. 10.5.4 四阶龙格-库塔方法及其MATLAB程序

2016年12月07日更新的函数(最近更新):

  1. matlab mxsetjc函数
  2. matlab mxgetjc函数
  3. matlab mxsetir函数
  4. matlab mxgetir函数
  5. matlab mxsetnzmax函数
  6. matlab mxgetnzmax函数
  7. matlab mxsetcell函数
  8. matlab mxgetcell函数
  9. matlab mxremovefield函数
  10. matlab mxaddfield函数
  11. matlab mxsetfieldbynumber函数
  12. matlab com.save函数
  13. matlab mxgetfieldbynumber函数
  14. matlab com.load函数
  15. matlab mxgetfieldnumber函数
  16. matlab mxasserts函数
  17. matlab move函数
  18. matlab mxassert函数
  19. matlab mxgetfieldnamebynumber函数
  20. matlab com.delete函数
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1