0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// This file is available under and governed by the GNU General Public 0N/A// License version 2 only, as published by the Free Software Foundation. 0N/A// However, the following notice accompanied the original version of this 2693N/A//--------------------------------------------------------------------------------- 2693N/A// Little Color Management System 6271N/A// Copyright (c) 1998-2012 Marti Maria Saguer 0N/A// Permission is hereby granted, free of charge, to any person obtaining 0N/A// a copy of this software and associated documentation files (the "Software"), 0N/A// to deal in the Software without restriction, including without limitation 0N/A// the rights to use, copy, modify, merge, publish, distribute, sublicense, 0N/A// and/or sell copies of the Software, and to permit persons to whom the Software 0N/A// is furnished to do so, subject to the following conditions: 0N/A// The above copyright notice and this permission notice shall be included in 0N/A// all copies or substantial portions of the Software. 0N/A// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 0N/A// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 0N/A// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 0N/A// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 0N/A// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 0N/A// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 0N/A// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2693N/A//--------------------------------------------------------------------------------- 0N/A// Multiply two matrices 0N/A a->v[i].n[0]*b->v[0].n[j] + a->v[i].n[
1]*b->v[
1].n[j] + a->v[i].n[
2]*b->v[
2].n[j]
0N/A// Inverse of a matrix b = a^(-1) 2693N/A c0 = a -> v[
1].n[
1]*a -> v[
2].n[
2] - a -> v[
1].n[
2]*a -> v[
2].n[
1];
2693N/A c1 = -a -> v[
1].n[0]*a -> v[
2].n[
2] + a -> v[
1].n[
2]*a -> v[
2].n[0];
2693N/A c2 = a -> v[
1].n[0]*a -> v[
2].n[
1] - a -> v[
1].n[
1]*a -> v[
2].n[0];
2693N/A b -> v[0].n[
1] = (a -> v[0].n[
2]*a -> v[
2].n[
1] - a -> v[0].n[
1]*a -> v[
2].n[
2])/
det;
2693N/A b -> v[0].n[
2] = (a -> v[0].n[
1]*a -> v[
1].n[
2] - a -> v[0].n[
2]*a -> v[
1].n[
1])/
det;
2693N/A b -> v[
1].n[
1] = (a -> v[0].n[0]*a -> v[
2].n[
2] - a -> v[0].n[
2]*a -> v[
2].n[0])/
det;
2693N/A b -> v[
1].n[
2] = (a -> v[0].n[
2]*a -> v[
1].n[0] - a -> v[0].n[0]*a -> v[
1].n[
2])/
det;
2693N/A b -> v[
2].n[
1] = (a -> v[0].n[
1]*a -> v[
2].n[0] - a -> v[0].n[0]*a -> v[
2].n[
1])/
det;
2693N/A b -> v[
2].n[
2] = (a -> v[0].n[0]*a -> v[
1].n[
1] - a -> v[0].n[
1]*a -> v[
1].n[0])/
det;
0N/A// Solve a system in the form Ax = b 2693N/A// Evaluate a vector across a matrix