///////////////////////////////////////////////////////////////////////////
//    Copyright (C) 2011 Wizardry and Steamworks - License: GNU GPLv3    //
///////////////////////////////////////////////////////////////////////////
// returns the dot-product of two matrices providing that
// the number of columns (ord_m) of matrix m is equal to
// the number of rows of matrix n
list wasMatrixDotProduct(list m, list n, integer ord_m, integer ord_n) {
    list result = [];
    integer i = 0;
    integer j = 0;
    do {
        do {
            integer sub_i = i;
            integer sub_j = j;
            float val = 0;
            do {
                val += llList2Float(m, sub_i) * llList2Float(n, sub_j);
                sub_j += ord_n;
                ++sub_i;
            } while(sub_j<llGetListLength(n));
            result += val;
        }
        while(++j<ord_n);
        i+=ord_m;
        j=0;
    } while(i<llGetListLength(m));
    return result;
}

secondlife/matrices/functions/dot_product.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.