Return-Path: Delivered-To: apmail-lucene-mahout-dev-archive@minotaur.apache.org Received: (qmail 34470 invoked from network); 9 Jun 2009 21:49:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Jun 2009 21:49:28 -0000 Received: (qmail 96687 invoked by uid 500); 9 Jun 2009 21:49:39 -0000 Delivered-To: apmail-lucene-mahout-dev-archive@lucene.apache.org Received: (qmail 96609 invoked by uid 500); 9 Jun 2009 21:49:39 -0000 Mailing-List: contact mahout-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mahout-dev@lucene.apache.org Delivered-To: mailing list mahout-dev@lucene.apache.org Received: (qmail 96599 invoked by uid 99); 9 Jun 2009 21:49:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2009 21:49:39 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [208.97.132.202] (HELO spunkymail-a4.g.dreamhost.com) (208.97.132.202) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2009 21:49:29 +0000 Received: from [192.168.0.105] (adsl-074-229-189-244.sip.rmo.bellsouth.net [74.229.189.244]) by spunkymail-a4.g.dreamhost.com (Postfix) with ESMTP id 758913BA03 for ; Tue, 9 Jun 2009 14:49:07 -0700 (PDT) Message-Id: From: Grant Ingersoll To: mahout-dev@lucene.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: A Bunch of Vector questions Date: Tue, 9 Jun 2009 17:49:06 -0400 X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org I'm looking into the whole labels thing as well as Vector stuff and I'm confused by a couple of things. 1. DirchletMapper assumes DenseVector implementation, no? Line 45? 2. Shouldn't DenseVector implement equals like SparseVector does? 3. VectorView doesn't appear to implement asFormatString consistently with the other Vectors. Adding: private static void doTestVectors(Vector left, Vector right) { left.setQuick(0, 1); left.setQuick(1, 2); left.setQuick(2, 3); right.setQuick(0, 4); right.setQuick(1, 5); right.setQuick(2, 6); double result = left.dot(right); assertEquals(result + " does not equal: " + 32, 32.0, result); String formattedString = left.asFormatString(); System.out.println("Vec: " + formattedString); Vector vec = AbstractVector.decodeVector(formattedString); assertTrue("vec is null and it shouldn't be", vec != null); assertTrue("Vector could not be decoded from the formatString", vec.equals(left)); } to VectorTest causes a failure for the VectorView test stuff. Shouldn't it output the format in a manner consistent with the underlying implementation? Thus, if it is a DenseVector, then it outputs that type, else if it is a Sparse it outputs the sparse type. Thoughts? -Grant