COPASI API  4.16.103
dbnorm.cpp File Reference
`#include <cmath>`
`#include <algorithm>`
`#include "copasi.h"`
`#include "dbnorm.h"`
Include dependency graph for dbnorm.cpp: Go to the source code of this file.

## Functions

double dbnorm_ (C_INT *n, double *a, C_INT *nra, C_INT *ml, C_INT *mu, double *w)

## Function Documentation

 double dbnorm_ ( C_INT * n, double * a, C_INT * nra, C_INT * ml, C_INT * mu, double * w )

Definition at line 31 of file dbnorm.cpp.

References C_INT, max, and min.

Referenced by CInternalSolver::dprja_().

33 {
34  /* System generated locals */
35  C_INT a_dim1, a_offset, i__1, i__2;
36  double ret_val, d__1, d__2;
37
38  /* Local variables */
39  C_INT i__, j, i1;
40  double an;
41  C_INT jhi, jlo;
42  double sum;
43
44  /* ----------------------------------------------------------------------- */
45  /* This function computes the norm of a banded N by N matrix, */
46  /* stored in the array A, that is consistent with the weighted max-norm */
47  /* on vectors, with weights stored in the array W. */
48  /* ML and MU are the lower and upper half-bandwidths of the matrix. */
49  /* NRA is the first dimension of the A array, NRA .ge. ML+MU+1. */
50  /* In terms of the matrix elements a(i,j), the norm is given by: */
51  /* DBNORM = MAX(i=1,...,N) (W(i) * Sum(j=1,...,N) ABS(a(i,j))/W(j)) */
52  /* ----------------------------------------------------------------------- */
54  --w;
55  a_dim1 = *nra;
56  a_offset = 1 + a_dim1;
57  a -= a_offset;
58
59  /* Function Body */
60  an = 0.;
61  i__1 = *n;
62
63  for (i__ = 1; i__ <= i__1; ++i__)
64  {
65  sum = 0.;
66  i1 = i__ + *mu + 1;
67  /* Computing MAX */
68  i__2 = i__ - *ml;
69  jlo = std::max(i__2, (C_INT)1);
70  /* Computing MIN */
71  i__2 = i__ + *mu;
72  jhi = std::min(i__2, *n);
73  i__2 = jhi;
74
75  for (j = jlo; j <= i__2; ++j)
76  {
77  /* L10: */
78  sum += (d__1 = a[i1 - j + j * a_dim1], fabs(d__1)) / w[j];
79  }
80
81  /* Computing MAX */
82  d__1 = an, d__2 = sum * w[i__];
83  an = std::max(d__1, d__2);
84  /* L20: */
85  }
86
87  ret_val = an;
88  return ret_val;
89  /* ----------------------- End of Function DBNORM ------------------------ */
90 } /* dbnorm_ */
#define C_INT
Definition: copasi.h:115
#define min(a, b)
Definition: f2c.h:175
#define max(a, b)
Definition: f2c.h:176
{"ft_lang_label":"__label__en","ft_lang_prob":0.62897325,"math_prob":0.97569954,"size":266,"snap":"2021-21-2021-25","text_gpt3_token_len":91,"char_repetition_ratio":0.16030534,"word_repetition_ratio":0.0,"special_character_ratio":0.31954888,"punctuation_ratio":0.26229507,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99676615,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-12T08:39:42Z\",\"WARC-Record-ID\":\"<urn:uuid:905c499c-3355-4d3c-8a25-aa513de48346>\",\"Content-Length\":\"16525\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7fd04fcb-df1f-48a5-a685-fa605ca3158c>\",\"WARC-Concurrent-To\":\"<urn:uuid:31c60373-2fc0-4263-8947-6813d4c89272>\",\"WARC-IP-Address\":\"185.199.109.153\",\"WARC-Target-URI\":\"https://copasi.org/static/API_Documentation/d6/db9/dbnorm_8cpp.html\",\"WARC-Payload-Digest\":\"sha1:TCE4JTZKMRVRLQ4HT7RYJEM6VPREYIOB\",\"WARC-Block-Digest\":\"sha1:32M5WE2IF3DZL6MADAO5XRQVXHHU7KP5\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243991685.16_warc_CC-MAIN-20210512070028-20210512100028-00373.warc.gz\"}"}