﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Bluebit Software Support Forum / Technical Support and Help / Matrix ActiveX Component  / Using LU in .NET and ActiveX / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Bluebit Software Support Forum</description><link>http://www.bluebit.gr/forum/</link><webMaster>support@bluebit.gr</webMaster><lastBuildDate>Wed, 08 Feb 2012 18:17:02 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Using LU in .NET and ActiveX</title><link>http://www.bluebit.gr/forum/Topic428-1-1.aspx</link><description>There is not a method that directly supports this in MaXC but you may write your own code. The way to do this is described here: &lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/LU_decomposition#Applications"&gt;http://en.wikipedia.org/wiki/LU_decomposition#Applications&lt;/A&gt;&lt;P&gt;It is true that our another product .NET Matrix Library supports this directly with its LU.Solve method.&lt;P&gt; &lt;P&gt; </description><pubDate>Fri, 07 Sep 2007 06:31:17 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title>RE: Using LU in .NET and ActiveX</title><link>http://www.bluebit.gr/forum/Topic428-1-1.aspx</link><description>That I understand, but how do I do the Solve method in the .NET LU is not covered.&lt;/P&gt;&lt;P&gt;Having the matrix to LU I can use:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;mtx-&amp;gt;LU(&amp;amp;l,&amp;amp;u,perIndex,&amp;amp;perSign);&lt;/P&gt;&lt;P&gt;but then I need to do the Solve against another matrix, using the l and u results from the decomposition? How do I do that?&lt;/P&gt;&lt;P&gt;-cpede&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 07 Sep 2007 05:35:14 GMT</pubDate><dc:creator>cpede</dc:creator></item><item><title>RE: Using LU in .NET and ActiveX</title><link>http://www.bluebit.gr/forum/Topic428-1-1.aspx</link><description>First of all there are two distinct products you may use. &lt;P&gt;".NET Matrix Library" (NML) is intended to be used with .NET languages such as VB.NET C# and managed C++ . &lt;/P&gt;&lt;P&gt;"Matrix ActiveX Component" (MaXC) is targeted to VB6 but it can be used by all languages supporting COM such as native C++.&lt;/P&gt;&lt;P&gt;I assume you want to use MaXC with C++. If yes it may help you the C++ project that is found in under the "Samples" directory. &lt;/P&gt;&lt;P&gt;I have modify the example in order to perform LU decomposition and here is the code:&lt;/P&gt;&lt;P&gt;[code]&lt;BR&gt;#include "stdafx.h"&lt;BR&gt;#include "iostream.h"&lt;BR&gt;#import "bluebitmatrix31.dll" no_namespace&lt;/P&gt;&lt;P&gt;HRESULT MatrixLU()&lt;BR&gt;{&lt;BR&gt; IMatrix *A;&lt;/P&gt;&lt;P&gt; long N  = 6;&lt;/P&gt;&lt;P&gt; HRESULT hr;&lt;BR&gt; hr = ::CoCreateInstance(__uuidof(Matrix), NULL, CLSCTX_INPROC, __uuidof(IMatrix), (void**)&amp;amp;A);&lt;BR&gt; if(FAILED(hr))&lt;BR&gt;  return hr; &lt;/P&gt;&lt;P&gt; A-&amp;gt;Size(N, N);&lt;BR&gt; A-&amp;gt;FillRandom(0, 10, 0);&lt;/P&gt;&lt;P&gt;&lt;BR&gt; cout &amp;lt;&amp;lt; "===============================" &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "Matrix A =" &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; A-&amp;gt;GetString(3, _bstr_t("")) &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "===============================" &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P&gt;&lt;BR&gt; //Declare 2 matrix variables that will hold&lt;BR&gt; //the L and U parts of LU decomposition&lt;BR&gt; IMatrix *L, *U;&lt;BR&gt; hr = ::CoCreateInstance(__uuidof(Matrix), NULL, CLSCTX_INPROC, __uuidof(IMatrix), (void**)&amp;amp;L);&lt;BR&gt; if(FAILED(hr))&lt;BR&gt;  return hr;&lt;BR&gt; hr = ::CoCreateInstance(__uuidof(Matrix), NULL, CLSCTX_INPROC, __uuidof(IMatrix), (void**)&amp;amp;U);&lt;BR&gt; if(FAILED(hr))&lt;BR&gt;  return hr;&lt;/P&gt;&lt;P&gt; VARIANT * perIndex ;&lt;BR&gt; perIndex = NULL;&lt;BR&gt; long perSign = 0;&lt;BR&gt; &lt;/P&gt;&lt;P&gt; A-&amp;gt;LU( &amp;amp;L, &amp;amp;U, perIndex, &amp;amp;perSign );&lt;BR&gt; &lt;/P&gt;&lt;P&gt; cout &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "===============================" &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "Matrix L =" &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; L-&amp;gt;GetString(3, _bstr_t("")) &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "===============================" &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P&gt;&lt;BR&gt; cout &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "===============================" &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "Matrix U =" &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; U-&amp;gt;GetString(3, _bstr_t("")) &amp;lt;&amp;lt; endl;&lt;BR&gt; cout &amp;lt;&amp;lt; "===============================" &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P&gt;&lt;BR&gt; if(A)&lt;BR&gt;  A-&amp;gt;Release();&lt;BR&gt; if(L)&lt;BR&gt;  L-&amp;gt;Release();&lt;BR&gt; if(U)&lt;BR&gt;  U-&amp;gt;Release();&lt;/P&gt;&lt;P&gt; return hr;&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;int main(int argc, char* argv[])&lt;BR&gt;{&lt;BR&gt; ::CoInitialize(NULL);&lt;BR&gt; MatrixLU();&lt;BR&gt; //cout &amp;lt;&amp;lt; "Please press return to exit";&lt;BR&gt; //cin.get();&lt;BR&gt; CoUninitialize();    // clearup&lt;BR&gt; return 0;&lt;BR&gt;}&lt;BR&gt;[/code]</description><pubDate>Tue, 04 Sep 2007 05:10:28 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title>RE: Using LU in .NET and ActiveX</title><link>http://www.bluebit.gr/forum/Topic428-1-1.aspx</link><description>It's not entirely clear how I should convert the Basic code to C++. For example, in C# we can call the solve function to return the result from an LU decomp. In C++ it works another way. Can you give me a little code clip that complements in C#:&lt;/P&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;P&gt;LU lu = new LU(mtx_l)&lt;BR&gt;&lt;/FONT&gt;Matrix res_u = lu.Solve(mtx_u);&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;-cpede</description><pubDate>Mon, 03 Sep 2007 09:52:38 GMT</pubDate><dc:creator>cpede</dc:creator></item><item><title>RE: Using LU in .NET and ActiveX</title><link>http://www.bluebit.gr/forum/Topic428-1-1.aspx</link><description>The ActiveX component uses a different interface and there is no LU object. You may use the LU method of the Matrix object. Please refer to the VB example given in the documentation:&lt;P&gt;&lt;A href="http://www.bluebit.gr/matrix/version_31/LU.htm"&gt;http://www.bluebit.gr/matrix/version_31/LU.htm&lt;/A&gt;&lt;P&gt;It should not be difficult to convert the above code in C++.</description><pubDate>Tue, 28 Aug 2007 03:38:37 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title>Using LU in .NET and ActiveX</title><link>http://www.bluebit.gr/forum/Topic428-1-1.aspx</link><description>To start with, I'm totally new to this.&lt;P&gt;One of my &lt;SPAN style="FONT-SIZE: 10pt; COLOR: #4b6e9d; FONT-FAMILY: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Tahoma; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;colleagues &lt;/SPAN&gt;made code in .NET using the LU class.&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;[code]LU lu = new LU(mtx_l);&lt;BR&gt;if (lu.IsSingular) return false;&lt;BR&gt;Matrix res_u = lu.Solve(mtx_u);[/code]&lt;/P&gt;&lt;P&gt;I'm now trying to convert this to C++ using the ActiveX version. I don't see the LU class, but only ad a method to Matrix.&lt;/P&gt;&lt;P&gt;Can anyone help me with an example on how to use the LU method in ActiveX?&lt;/P&gt;&lt;P&gt;-cpede&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 28 Aug 2007 02:49:41 GMT</pubDate><dc:creator>cpede</dc:creator></item></channel></rss>
