Ignore:
Timestamp:
Dec 13, 2025, 4:56:22 PM (9 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
5d300ba
Parents:
67748f9
Message:

more array proofreading

Location:
doc/theses/mike_brooks_MMath/programs
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa

    r67748f9 r35fc819  
    3131int getPref( @School( C, S ) & school@, int is, int pref ) {
    3232        for ( ic; C ) {
    33                 if ( pref == @school.preferences@[ic][is]; ) return ic; $\C{// offset calculation implicit}$
     33                if ( pref == @school.preferences@[ic][is] ) return ic; $\C{// offset calculation implicit}$
    3434        }
    35         assert( false );
     35        assert( false );        // must find a match
    3636}
    3737
     
    8989
    9090        for ( is; ns ) {
    91                 sout | school.student_ids[is] | ": " | nonl;
     91                sout | school.student_ids[is] | ": ";
    9292                for ( pref; 1 ~= nc ) {
    9393                        int ic = getPref( school, is, pref );
  • doc/theses/mike_brooks_MMath/programs/hello-array.cfa

    r67748f9 r35fc819  
    8989
    9090forall( [M], [N] )
    91 void bad( array(float, M) &x,
    92                 array(float, N) &y ) {
     91void f( array(float, M) &x, array(float, N) &y ) {
    9392        f( x, x );              $\C[0.5in]{// ok}$
    9493        f( y, y );              $\C{// ok}$
    95 
    9694        f( x, y );              $\C{// error}\CRT$
     95        if ( M == N ) f( x, @(array( float, M ) &)@y ); $\C{// ok}\CRT$
    9796}
    98 
    9997#endif
    10098
     
    109107
    110108forall( [M], [N] )
    111 void bad_fixed( array( float, M ) & x,
    112                 array( float, N ) & y ) {
     109void f( array( float, M ) & x, array( float, N ) & y ) {
    113110        f( x, x );              $\C[0.5in]{// ok}$
    114111        f( y, y );              $\C{// ok}$
    115         if ( M == N )
    116                 f( x, @(array( float, M ) &)@y ); $\C{// ok}\CRT$
     112        if ( M == N ) f( x, @(array( float, M ) &)@y ); $\C{// ok}\CRT$
    117113}
    118114
     
    132128
    133129forall( [M], [N] )
    134 void bad_ok_only( array(float, M) &x,
    135                 array(float, N) &y ) {
     130void bad_ok_only( array(float, M) &x, array(float, N) &y ) {
    136131        f( x, x );
    137132        f( y, y );
  • doc/theses/mike_brooks_MMath/programs/school1

    r67748f9 r35fc819  
    113 courses, 2 students
    2 c\s     90111111 90222222
    3 ENGL101        3        2
    4 PHYS101        1        3
    5 CHEM101        2        1
     2c\s              90111111 90222222
     3ENGL101                 3               2
     4PHYS101                 1               3
     5CHEM101                2               1
  • doc/theses/mike_brooks_MMath/programs/school1.out

    r67748f9 r35fc819  
    1 90111111: PHYS101 CHEM101 ENGL101
    2 90222222: CHEM101 ENGL101 PHYS101
     190111111:
     2PHYS101 CHEM101 ENGL101
     390222222:
     4CHEM101 ENGL101 PHYS101
  • doc/theses/mike_brooks_MMath/programs/school2

    r67748f9 r35fc819  
    115 courses, 3 students
    2 c\s     90111111 90222222 90333333
    3 ENGL101        3        2        3
    4 PHYS101        1        3        4
    5 CHEM101        2        1        5
    6 PHIL101        4        5        2
    7 MATH499        5        4        1
     2c\s              90111111 90222222 90333333
     3ENGL101                 3               2               3
     4PHYS101                 1               3               4
     5CHEM101                2               1               5
     6PHIL101                   4               5               2
     7MATH499                 5               4               1
  • doc/theses/mike_brooks_MMath/programs/school2.out

    r67748f9 r35fc819  
    1 90111111: PHYS101 CHEM101 ENGL101 PHIL101 MATH499
    2 90222222: CHEM101 ENGL101 PHYS101 MATH499 PHIL101
    3 90333333: MATH499 PHIL101 ENGL101 PHYS101 CHEM101
     190111111:
     2PHYS101 CHEM101 ENGL101 PHIL101 MATH499
     390222222:
     4CHEM101 ENGL101 PHYS101 MATH499 PHIL101
     590333333:
     6MATH499 PHIL101 ENGL101 PHYS101 CHEM101
Note: See TracChangeset for help on using the changeset viewer.