petsc-3.7.1 2016-05-15
Report Typos and Errors

# MatCreateSeqAIJFromTriple

Creates an sequential AIJ matrix using matrix elements (in COO format) provided by the user.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode  MatCreateSeqAIJFromTriple(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt *i,PetscInt *j,PetscScalar *a,Mat *mat,PetscInt nz,PetscBool idx)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - must be an MPI communicator of size 1 Many br
| m | - number of rows Many br
| n | - number of columns Many br
| i | - row indices Many br
| j | - column indices Many br
| a | - matrix values Many br
| nz | - number of nonzeros Many br
| idx | - 0 or 1 based Many br

### Output Parameter

mat -the matrix Many br

Many br

### Notes

The i and j indices are 0 based Many br

The format which is used for the sparse matrix input, is equivalent to a Many brrow-major ordering.. i.e for the following matrix, the input data expected is Many br

### as shown

1 0 0 Many br2 0 3 Many br4 5 6 Many br

i = {0,1,1,2,2,2} Many brj = {0,0,2,0,1,2} Many brv = {1,2,3,4,5,6} Many br

### See Also

MatCreate(), MatCreateAIJ(), MatCreateSeqAIJ(), MatCreateSeqAIJWithArrays(), MatMPIAIJSetPreallocationCSR()

Level:intermediate
Location:src/mat/impls/aij/seq/aij.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages