NeoPZ
Macros | Functions
rcm.cpp File Reference
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <ctime>
#include <string>
#include "rcm.h"
Include dependency graph for rcm.cpp:

Go to the source code of this file.

Macros

#define ADJ_NUM
 
#define NODE_NUM
 
#define OFFSET
 
#define INCX
 
#define INCX
 
#define INCX
 
#define INCX
 
#define TIME_SIZE
 
#define DIM_NUM
 
#define NODE_NUM
 
#define TRIANGLE_NUM
 
#define TRIANGLE_ORDER
 
#define DIM_NUM
 
#define NODE_NUM
 
#define TRIANGLE_NUM
 
#define TRIANGLE_ORDER
 

Functions

int adj_bandwidth (int node_num, int adj_num, int adj_row[], int adj[])
 
bool adj_contains_ij (int node_num, int adj_num, int adj_row[], int adj[], int i, int j)
 
void adj_insert_ij (int node_num, int adj_max, int *adj_num, int adj_row[], int adj[], int i, int j)
 
int adj_perm_bandwidth (int node_num, int adj_num, int adj_row[], int adj[], int perm[], int perm_inv[])
 
void adj_perm_show (int node_num, int adj_num, int adj_row[], int adj[], int perm[], int perm_inv[])
 
void adj_print (int node_num, int adj_num, int adj_row[], int adj[], string title)
 
void adj_print_some (int node_num, int node_lo, int node_hi, int adj_num, int adj_row[], int adj[], string title)
 
void adj_set (int node_num, int adj_max, int *adj_num, int adj_row[], int adj[], int irow, int jcol)
 
void adj_show (int node_num, int adj_num, int adj_row[], int adj[])
 
void degree (int root, int adj_num, int adj_row[], int adj[], int mask[], int deg[], int *iccsze, int ls[], int node_num)
 
void genrcm (int node_num, int adj_num, int adj_row[], int adj[], int perm[])
 
void graph_01_adj (int node_num, int adj_num, int adj_row[], int adj[])
 
void graph_01_size (int *node_num, int *adj_num)
 
int i4_max (int i1, int i2)
 
int i4_min (int i1, int i2)
 
int i4_sign (int i)
 
void i4_swap (int *i, int *j)
 
int i4_uniform (int a, int b, int *seed)
 
int i4col_compare (int m, int n, int a[], int i, int j)
 
void i4col_sort_a (int m, int n, int a[])
 
void i4col_swap (int m, int n, int a[], int icol1, int icol2)
 
void i4mat_print_some (int m, int n, int a[], int ilo, int jlo, int ihi, int jhi, string title)
 
void i4mat_transpose_print (int m, int n, int a[], string title)
 
void i4mat_transpose_print_some (int m, int n, int a[], int ilo, int jlo, int ihi, int jhi, string title)
 
void i4vec_heap_d (int n, int a[])
 
int * i4vec_indicator (int n)
 
void i4vec_print (int n, int a[], string title)
 
void i4vec_reverse (int n, int a[])
 
void i4vec_sort_heap_a (int n, int a[])
 
void level_set (int root, int adj_num, int adj_row[], int adj[], int mask[], int *level_num, int level_row[], int level[], int node_num)
 
void level_set_print (int node_num, int level_num, int level_row[], int level[])
 
bool perm_check (int n, int p[])
 
void perm_inverse3 (int n, int perm[], int perm_inv[])
 
int * perm_uniform (int n, int *seed)
 
float r4_abs (float x)
 
int r4_nint (float x)
 
void r82vec_permute (int n, double a[], int p[])
 
void r8mat_print_some (int m, int n, double a[], int ilo, int jlo, int ihi, int jhi, string title)
 
void r8mat_transpose_print_some (int m, int n, double a[], int ilo, int jlo, int ihi, int jhi, string title)
 
void rcm (int root, int adj_num, int adj_row[], int adj[], int mask[], int perm[], int *iccsze, int node_num)
 
void root_find (int *root, int adj_num, int adj_row[], int adj[], int mask[], int *level_num, int level_row[], int level[], int node_num)
 
void sort_heap_external (int n, int *indx, int *i, int *j, int isgn)
 
void timestamp (void)
 
int * triangulation_neighbor_triangles (int triangle_order, int triangle_num, int triangle_node[])
 
int triangulation_order3_adj_count (int node_num, int triangle_num, int triangle_node[], int triangle_neighbor[], int adj_col[])
 
int * triangulation_order3_adj_set (int node_num, int triangle_num, int triangle_node[], int triangle_neighbor[], int adj_num, int adj_col[])
 
void triangulation_order3_example2 (int node_num, int triangle_num, double node_xy[], int triangle_node[], int triangle_neighbor[])
 
void triangulation_order3_example2_size (int *node_num, int *triangle_num, int *hole_num)
 
int triangulation_order6_adj_count (int node_num, int triangle_num, int triangle_node[], int triangle_neighbor[], int adj_col[])
 
int * triangulation_order6_adj_set (int node_num, int triangle_num, int triangle_node[], int triangle_neighbor[], int adj_num, int adj_col[])
 
void triangulation_order6_example2 (int node_num, int triangle_num, double node_xy[], int triangle_node[], int triangle_neighbor[])
 
void triangulation_order6_example2_size (int *node_num, int *triangle_num, int *hole_num)
 

Macro Definition Documentation

◆ ADJ_NUM

#define ADJ_NUM

Referenced by graph_01_adj().

◆ DIM_NUM [1/2]

#define DIM_NUM

◆ DIM_NUM [2/2]

#define DIM_NUM

◆ INCX [1/4]

#define INCX

◆ INCX [2/4]

#define INCX

◆ INCX [3/4]

#define INCX

◆ INCX [4/4]

#define INCX

◆ NODE_NUM [1/3]

#define NODE_NUM

◆ NODE_NUM [2/3]

#define NODE_NUM

◆ NODE_NUM [3/3]

#define NODE_NUM

◆ OFFSET

#define OFFSET

Referenced by i4col_swap().

◆ TIME_SIZE

#define TIME_SIZE

Referenced by timestamp().

◆ TRIANGLE_NUM [1/2]

#define TRIANGLE_NUM

◆ TRIANGLE_NUM [2/2]

#define TRIANGLE_NUM

◆ TRIANGLE_ORDER [1/2]

#define TRIANGLE_ORDER

◆ TRIANGLE_ORDER [2/2]

#define TRIANGLE_ORDER

Function Documentation

◆ adj_bandwidth()

int adj_bandwidth ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[] 
)

Definition at line 19 of file rcm.cpp.

References i4_max().

◆ adj_contains_ij()

bool adj_contains_ij ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[],
int  i,
int  j 
)

Definition at line 92 of file rcm.cpp.

Referenced by adj_set().

◆ adj_insert_ij()

void adj_insert_ij ( int  node_num,
int  adj_max,
int *  adj_num,
int  adj_row[],
int  adj[],
int  i,
int  j 
)

Definition at line 187 of file rcm.cpp.

Referenced by adj_set().

◆ adj_perm_bandwidth()

int adj_perm_bandwidth ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[],
int  perm[],
int  perm_inv[] 
)

Definition at line 279 of file rcm.cpp.

References i4_max().

◆ adj_perm_show()

void adj_perm_show ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[],
int  perm[],
int  perm_inv[] 
)

Definition at line 357 of file rcm.cpp.

References i4_max().

◆ adj_print()

void adj_print ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[],
string  title 
)

Definition at line 468 of file rcm.cpp.

References adj_print_some().

◆ adj_print_some()

void adj_print_some ( int  node_num,
int  node_lo,
int  node_hi,
int  adj_num,
int  adj_row[],
int  adj[],
string  title 
)

Definition at line 522 of file rcm.cpp.

References i4_min().

Referenced by adj_print().

◆ adj_set()

void adj_set ( int  node_num,
int  adj_max,
int *  adj_num,
int  adj_row[],
int  adj[],
int  irow,
int  jcol 
)

Definition at line 637 of file rcm.cpp.

References adj_contains_ij(), and adj_insert_ij().

◆ adj_show()

void adj_show ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[] 
)

Definition at line 776 of file rcm.cpp.

◆ degree()

void degree ( int  root,
int  adj_num,
int  adj_row[],
int  adj[],
int  mask[],
int  deg[],
int *  iccsze,
int  ls[],
int  node_num 
)

◆ genrcm()

void genrcm ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[],
int  perm[] 
)

Definition at line 1014 of file rcm.cpp.

References rcm(), and root_find().

◆ graph_01_adj()

void graph_01_adj ( int  node_num,
int  adj_num,
int  adj_row[],
int  adj[] 
)

Definition at line 1127 of file rcm.cpp.

References ADJ_NUM, and NODE_NUM.

◆ graph_01_size()

void graph_01_size ( int *  node_num,
int *  adj_num 
)

Definition at line 1198 of file rcm.cpp.

◆ i4_max()

int i4_max ( int  i1,
int  i2 
)

◆ i4_min()

int i4_min ( int  i1,
int  i2 
)

◆ i4_sign()

int i4_sign ( int  i)

Definition at line 1316 of file rcm.cpp.

◆ i4_swap()

void i4_swap ( int *  i,
int *  j 
)

Definition at line 1356 of file rcm.cpp.

Referenced by perm_uniform().

◆ i4_uniform()

int i4_uniform ( int  a,
int  b,
int *  seed 
)

Definition at line 1392 of file rcm.cpp.

References i4_max(), i4_min(), and r4_nint().

Referenced by perm_uniform().

◆ i4col_compare()

int i4col_compare ( int  m,
int  n,
int  a[],
int  i,
int  j 
)

Definition at line 1490 of file rcm.cpp.

Referenced by i4col_sort_a().

◆ i4col_sort_a()

void i4col_sort_a ( int  m,
int  n,
int  a[] 
)

Definition at line 1600 of file rcm.cpp.

References i4col_compare(), i4col_swap(), and sort_heap_external().

Referenced by triangulation_neighbor_triangles().

◆ i4col_swap()

void i4col_swap ( int  m,
int  n,
int  a[],
int  icol1,
int  icol2 
)

Definition at line 1687 of file rcm.cpp.

References m, and OFFSET.

Referenced by i4col_sort_a().

◆ i4mat_print_some()

void i4mat_print_some ( int  m,
int  n,
int  a[],
int  ilo,
int  jlo,
int  ihi,
int  jhi,
string  title 
)

Definition at line 1765 of file rcm.cpp.

References i4_max(), i4_min(), and INCX.

◆ i4mat_transpose_print()

void i4mat_transpose_print ( int  m,
int  n,
int  a[],
string  title 
)

Definition at line 1863 of file rcm.cpp.

References i4mat_transpose_print_some().

◆ i4mat_transpose_print_some()

void i4mat_transpose_print_some ( int  m,
int  n,
int  a[],
int  ilo,
int  jlo,
int  ihi,
int  jhi,
string  title 
)

Definition at line 1901 of file rcm.cpp.

References i4_max(), i4_min(), and INCX.

Referenced by i4mat_transpose_print().

◆ i4vec_heap_d()

void i4vec_heap_d ( int  n,
int  a[] 
)

Definition at line 1999 of file rcm.cpp.

References m.

Referenced by i4vec_sort_heap_a().

◆ i4vec_indicator()

int* i4vec_indicator ( int  n)

Definition at line 2127 of file rcm.cpp.

◆ i4vec_print()

void i4vec_print ( int  n,
int  a[],
string  title 
)

Definition at line 2168 of file rcm.cpp.

Referenced by r82vec_permute().

◆ i4vec_reverse()

void i4vec_reverse ( int  n,
int  a[] 
)

Definition at line 2212 of file rcm.cpp.

Referenced by rcm().

◆ i4vec_sort_heap_a()

void i4vec_sort_heap_a ( int  n,
int  a[] 
)

Definition at line 2264 of file rcm.cpp.

References i4vec_heap_d().

Referenced by triangulation_order3_adj_set(), and triangulation_order6_adj_set().

◆ level_set()

void level_set ( int  root,
int  adj_num,
int  adj_row[],
int  adj[],
int  mask[],
int *  level_num,
int  level_row[],
int  level[],
int  node_num 
)

Definition at line 2341 of file rcm.cpp.

Referenced by root_find().

◆ level_set_print()

void level_set_print ( int  node_num,
int  level_num,
int  level_row[],
int  level[] 
)

Definition at line 2479 of file rcm.cpp.

References i4_min().

◆ perm_check()

bool perm_check ( int  n,
int  p[] 
)

Definition at line 2577 of file rcm.cpp.

Referenced by r82vec_permute().

◆ perm_inverse3()

void perm_inverse3 ( int  n,
int  perm[],
int  perm_inv[] 
)

Definition at line 2639 of file rcm.cpp.

◆ perm_uniform()

int* perm_uniform ( int  n,
int *  seed 
)

Definition at line 2679 of file rcm.cpp.

References i4_swap(), and i4_uniform().

◆ r4_abs()

float r4_abs ( float  x)

Definition at line 2736 of file rcm.cpp.

Referenced by r4_nint().

◆ r4_nint()

int r4_nint ( float  x)

Definition at line 2777 of file rcm.cpp.

References r4_abs().

Referenced by i4_uniform().

◆ r82vec_permute()

void r82vec_permute ( int  n,
double  a[],
int  p[] 
)

Definition at line 2832 of file rcm.cpp.

References i4vec_print(), and perm_check().

◆ r8mat_print_some()

void r8mat_print_some ( int  m,
int  n,
double  a[],
int  ilo,
int  jlo,
int  ihi,
int  jhi,
string  title 
)

Definition at line 2968 of file rcm.cpp.

References i4_max(), i4_min(), and INCX.

◆ r8mat_transpose_print_some()

void r8mat_transpose_print_some ( int  m,
int  n,
double  a[],
int  ilo,
int  jlo,
int  ihi,
int  jhi,
string  title 
)

Definition at line 3066 of file rcm.cpp.

References i4_max(), i4_min(), INCX, and m.

◆ rcm()

void rcm ( int  root,
int  adj_num,
int  adj_row[],
int  adj[],
int  mask[],
int  perm[],
int *  iccsze,
int  node_num 
)

Definition at line 3153 of file rcm.cpp.

References degree(), and i4vec_reverse().

Referenced by genrcm().

◆ root_find()

void root_find ( int *  root,
int  adj_num,
int  adj_row[],
int  adj[],
int  mask[],
int *  level_num,
int  level_row[],
int  level[],
int  node_num 
)

Definition at line 3340 of file rcm.cpp.

References level_set().

Referenced by genrcm().

◆ sort_heap_external()

void sort_heap_external ( int  n,
int *  indx,
int *  i,
int *  j,
int  isgn 
)

Definition at line 3533 of file rcm.cpp.

Referenced by i4col_sort_a().

◆ timestamp()

void timestamp ( void  )

Definition at line 3719 of file rcm.cpp.

References TIME_SIZE.

◆ triangulation_neighbor_triangles()

int* triangulation_neighbor_triangles ( int  triangle_order,
int  triangle_num,
int  triangle_node[] 
)

Definition at line 3767 of file rcm.cpp.

References i4col_sort_a().

◆ triangulation_order3_adj_count()

int triangulation_order3_adj_count ( int  node_num,
int  triangle_num,
int  triangle_node[],
int  triangle_neighbor[],
int  adj_col[] 
)

Definition at line 4000 of file rcm.cpp.

◆ triangulation_order3_adj_set()

int* triangulation_order3_adj_set ( int  node_num,
int  triangle_num,
int  triangle_node[],
int  triangle_neighbor[],
int  adj_num,
int  adj_col[] 
)

Definition at line 4205 of file rcm.cpp.

References i4vec_sort_heap_a().

◆ triangulation_order3_example2()

void triangulation_order3_example2 ( int  node_num,
int  triangle_num,
double  node_xy[],
int  triangle_node[],
int  triangle_neighbor[] 
)

Definition at line 4433 of file rcm.cpp.

References DIM_NUM, NODE_NUM, TRIANGLE_NUM, and TRIANGLE_ORDER.

◆ triangulation_order3_example2_size()

void triangulation_order3_example2_size ( int *  node_num,
int *  triangle_num,
int *  hole_num 
)

Definition at line 4613 of file rcm.cpp.

◆ triangulation_order6_adj_count()

int triangulation_order6_adj_count ( int  node_num,
int  triangle_num,
int  triangle_node[],
int  triangle_neighbor[],
int  adj_col[] 
)

Definition at line 4667 of file rcm.cpp.

◆ triangulation_order6_adj_set()

int* triangulation_order6_adj_set ( int  node_num,
int  triangle_num,
int  triangle_node[],
int  triangle_neighbor[],
int  adj_num,
int  adj_col[] 
)

Definition at line 4954 of file rcm.cpp.

References i4vec_sort_heap_a().

◆ triangulation_order6_example2()

void triangulation_order6_example2 ( int  node_num,
int  triangle_num,
double  node_xy[],
int  triangle_node[],
int  triangle_neighbor[] 
)

Definition at line 5293 of file rcm.cpp.

References DIM_NUM, NODE_NUM, TRIANGLE_NUM, and TRIANGLE_ORDER.

◆ triangulation_order6_example2_size()

void triangulation_order6_example2_size ( int *  node_num,
int *  triangle_num,
int *  hole_num 
)

Definition at line 5436 of file rcm.cpp.